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

Ensure that code quality checks are running #204

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
46 changes: 41 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ jobs:
restore-keys: |
${{ matrix.python-version }}-v1-

- name: Install Selenium dependencies
run: |
sudo apt-get -qq update
sudo apt-get -y install firefox xvfb

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -90,3 +85,44 @@ jobs:
uses: codecov/codecov-action@v2
with:
name: Python ${{ matrix.python-version }}

tox_checks:
name: Run tox environment ${{ matrix.tox-env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tox-env: ['quality', 'dist-validation']

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions

- name: Tox tests
run: tox -e ${{ matrix.tox-env }} -v

qunit:
name: Visual tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Install Selenium dependencies
run: |
sudo apt-get -qq update
sudo apt-get -y install firefox xvfb

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions

- name: Tox tests
run: tox -e qunit -v
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.PHONY: quality requirements

CHECK_DIRS?=example sortedm2m sortedm2m_tests test_project *.py

quality: ## Run isort, pycodestyle, and Pylint
isort --check-only --recursive .
pycodestyle example sortedm2m sortedm2m_tests test_project *.py
pylint --rcfile=pylintrc example sortedm2m sortedm2m_tests test_project *.py
isort --check-only $(CHECK_DIRS)
pycodestyle $(CHECK_DIRS)
DJANGO_SETTINGS_MODULE=test_project.settings pylint --errors-only --load-plugins pylint_django $(CHECK_DIRS)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the --rcfile is the most opinionated change here - the problem is that I don't have instructions to re-generate the file and the current file is too old and has tons of options that doesn't work anymore. While I can do pylint --generate-rcfile, this results in a completely different file from what's there, the diff is so large that it's unhelpful. If I had a set of changes that were previously applied to the file last time it was generated, I could go about re-applying those, but I don't know how to get that.

Because of this, I turned it on in the less-strict mode of --errors-only.


requirements: ## Install requirements for development
pip install -r requirements.txt
Loading