Skip to content

Commit

Permalink
Updating static checks (#5637)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Sachs <[email protected]>
  • Loading branch information
galvana and adamsachs authored Jan 7, 2025
1 parent 22c05f2 commit b805c8c
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 43 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/backend_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,43 +75,6 @@ jobs:
path: /tmp/python-${{ matrix.python_version }}.tar
retention-days: 1

###################
## Static Checks ##
###################
Static-Checks:
strategy:
matrix:
session_name:
[
'"isort(check)"',
'"black(check)"',
"mypy",
"pylint",
"xenon",
"check_install",
'"pytest(nox)"',
]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
cache: "pip"

- name: Install Nox
run: pip install nox>=2022

- name: Install Dev Requirements
run: pip install -r dev-requirements.txt

- name: Run Static Check
run: nox -s ${{ matrix.session_name }}

##################
## Performance ##
##################
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Backend Static Code Checks

on:
pull_request:
push:
branches:
- "main"
- "release-**"

env:
IMAGE: ethyca/fides:local
DEFAULT_PYTHON_VERSION: "3.10.13"
# Docker auth with read-only permissions.
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_RO_TOKEN: ${{ secrets.DOCKER_RO_TOKEN }}

jobs:
###################
## Static Checks ##
###################
Static-Checks:
strategy:
matrix:
session_name:
[
'"isort(check)"',
'"black(check)"',
"mypy",
"pylint",
"xenon",
"check_install",
'"pytest(nox)"',
]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
cache: "pip"

- name: Install Nox
run: pip install nox>=2022

- name: Install Dev Requirements
run: pip install -r dev-requirements.txt

- name: Run Static Check
run: nox -s ${{ matrix.session_name }}
18 changes: 12 additions & 6 deletions noxfiles/ci_nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,19 @@ def xenon(session: nox.Session) -> None:
"src",
"tests",
"scripts",
"--max-absolute B",
"--max-modules B",
"--max-average A",
"--ignore 'data, docs'",
"--exclude src/fides/_version.py",
"--max-absolute=B",
"--max-modules=B",
"--max-average=A",
"--ignore=data,docs",
"--exclude=src/fides/_version.py",
)
session.run(*command, success_codes=[0, 1])
session.warn(
"Note: This command was malformed so it's been failing to report complexity issues."
)
session.warn(
"Intentionally suppressing the error status code for now to slowly work through the issues."
)
session.run(*command)


##################
Expand Down

0 comments on commit b805c8c

Please sign in to comment.