-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ASFHyP3/ruff
Add static analysis for Ruff and cfn-lint, keep it up to date with dependabot
- Loading branch information
Showing
7 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
labels: | ||
- "bumpless" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
labels: | ||
- "bumpless" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Static analysis | ||
|
||
on: push | ||
|
||
jobs: | ||
call-ruff-workflow: | ||
uses: ASFHyP3/actions/.github/workflows/[email protected] | ||
|
||
cfn-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
- run: make install | ||
- run: make cfn-lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export PYTHONPATH = ${PWD}/landsat/src | ||
|
||
install: | ||
python -m pip install --upgrade pip && \ | ||
python -m pip install -r requirements-all.txt | ||
|
||
install-lambda-deps: | ||
python -m pip install --upgrade pip && \ | ||
python -m pip install -r requirements-landsat.txt -t landsat/src/ | ||
|
||
test_file ?= 'tests/' | ||
test: | ||
pytest $(test_file) | ||
|
||
static: ruff-check cfn-lint | ||
|
||
ruff-check: | ||
ruff check | ||
|
||
ruff-format: | ||
ruff format | ||
|
||
ruff: ruff-check ruff-format | ||
|
||
cfn-lint: | ||
cfn-lint --template `find . -name cloudformation.yml` --info --ignore-checks W3002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: its-live-monitoring | ||
dependencies: | ||
- python=3.12 | ||
- pip | ||
- pip: | ||
- -r requirements-all.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cfn-lint | ||
ruff | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
line-length = 120 | ||
src = ["landsat/src", "tests"] | ||
|
||
[format] | ||
indent-style = "space" | ||
quote-style = "single" | ||
|
||
[lint] | ||
extend-select = [ | ||
"I", # isort: https://docs.astral.sh/ruff/rules/#isort-i | ||
"UP", # pyupgrade: https://docs.astral.sh/ruff/rules/#pyupgrade-up | ||
"D", # pydocstyle: https://docs.astral.sh/ruff/rules/#pydocstyle-d | ||
"ANN", # annotations: https://docs.astral.sh/ruff/rules/#flake8-annotations-ann | ||
"PTH", # use-pathlib-pth: https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth | ||
] | ||
|
||
[lint.pydocstyle] | ||
convention = "google" | ||
|
||
[lint.isort] | ||
case-sensitive = true | ||
lines-after-imports = 2 |