Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating static checks #5637

Merged
merged 9 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: Static Code Checks
galvana marked this conversation as resolved.
Show resolved Hide resolved

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.log(
"Note: This command was malformed so it's been failing to report complexity issues."
)
session.log(
"Intentionally suppressing the error status code for now to slowly work through the issues."
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only thing we didn't discuss on Slack, let me know your thoughts on this one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! looks good to me. could be a session.warn maybe, but perhaps that's a bit too noisy? i'm fine either way

session.run(*command)


##################
Expand Down
Loading