-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add pyproject-fmt to quality tools. - Remove safety from quality tools. - Remove duplication between quality.sh scripts. Closes #8928.
- Loading branch information
Showing
39 changed files
with
952 additions
and
642 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
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,27 @@ | ||
name: Application tests quality | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: | | ||
cd tests/application_tests | ||
ci/pip-install.sh | ||
- name: Test | ||
run: | | ||
cd tests/application_tests | ||
ci/unittest.sh | ||
- name: Quality | ||
run: | | ||
cd tests/application_tests | ||
ci/quality.sh |
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 @@ | ||
name: Release script quality | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies and run quality checks | ||
run: | | ||
cd release | ||
python -m venv venv | ||
. venv/bin/activate | ||
ci/pip-install.sh | ||
ci/quality.sh |
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,50 @@ | ||
#!/bin/bash | ||
|
||
# Get the dir of this script so the base.sh script that is in the same dir as this script can be sourced: | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source $SCRIPT_DIR/base.sh | ||
|
||
run_ruff() { | ||
run_pipx ruff check . | ||
run_pipx ruff format --check . | ||
} | ||
|
||
run_fixit() { | ||
run_pipx fixit lint ${@:-src tests} | ||
} | ||
|
||
run_mypy() { | ||
run_pipx mypy --python-executable=$(which python) ${@:-src tests} | ||
} | ||
|
||
run_mypy_pydantic() { | ||
# To use the pydantic plugin, we need to first install mypy and then inject the plugin | ||
run pipx install --force `spec mypy` # --force works around this bug: https://github.com/pypa/pipx/issues/795 | ||
run pipx inject mypy `spec pydantic` | ||
run $PIPX_BIN_DIR/mypy src --python-executable=$(which python) | ||
} | ||
|
||
run_pyproject_fmt() { | ||
run_pipx pyproject-fmt --check pyproject.toml | ||
} | ||
|
||
run_bandit() { | ||
run_pipx bandit --configfile pyproject.toml --quiet --recursive src | ||
} | ||
|
||
run_pip_audit() { | ||
run_pipx pip-audit --strict --progress-spinner=off ${@:--r requirements/requirements.txt -r requirements/requirements-dev.txt} | ||
} | ||
|
||
run_vulture() { | ||
run_pipx vulture --min-confidence 0 ${@:-src tests} .vulture_ignore_list.py | ||
} | ||
|
||
run_vale() { | ||
run_pipx vale sync | ||
run_pipx vale --no-wrap src/*.md | ||
} | ||
|
||
run_markdownlint() { | ||
run ./node_modules/markdownlint-cli/markdownlint.js src/*.md | ||
} |
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 |
---|---|---|
@@ -1,31 +1,11 @@ | ||
#!/bin/bash | ||
|
||
source ../../ci/base.sh | ||
|
||
# Ruff | ||
run pipx run `spec ruff` check . | ||
run pipx run `spec ruff` format --check . | ||
|
||
# Fixit | ||
run pipx run `spec fixit` lint src tests | ||
|
||
# Mypy | ||
run pipx run `spec mypy` --python-executable=$(which python) src | ||
|
||
# pip-audit | ||
run pipx run `spec pip-audit` --strict --progress-spinner=off -r requirements/requirements.txt -r requirements/requirements-dev.txt | ||
|
||
# Safety | ||
# Vulnerability ID: 67599 | ||
# ADVISORY: ** DISPUTED ** An issue was discovered in pip (all versions) because it installs the version with the | ||
# highest version number, even if the user had intended to obtain a private package from a private index. This only | ||
# affects use of the --extra-index-url option, and exploitation requires that the... | ||
# CVE-2018-20225 | ||
# For more information about this vulnerability, visit https://data.safetycli.com/v/67599/97c | ||
run pipx run `spec safety` check --bare --ignore 67599 -r requirements/requirements.txt -r requirements/requirements-dev.txt | ||
|
||
# Bandit | ||
run pipx run `spec bandit` --quiet --recursive src/ | ||
|
||
# Vulture | ||
run pipx run `spec vulture` --min-confidence 0 src/ tests/ .vulture_ignore_list.py | ||
source ../../ci/quality-base.sh | ||
|
||
run_ruff | ||
run_fixit | ||
run_mypy | ||
run_pyproject_fmt | ||
run_pip_audit | ||
run_bandit | ||
run_vulture |
Oops, something went wrong.