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

Update pre-commit config & using it to lint on CI #428

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ on:
- pull_request

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
Comment on lines +11 to +20
Copy link
Author

Choose a reason for hiding this comment

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

Alternative: use https://pre-commit.ci/ instead. However it needs a maintainer to authorise it


tests:
runs-on: ubuntu-latest
strategy:
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: "v4.4.0"
hooks:
# - id: trailing-whitespace
# - id: end-of-file-fixer
# - id: check-yaml
- id: check-added-large-files

- repo: https://github.com/asottile/pyupgrade
rev: v2.38.4
rev: "v3.3.2"
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]

- repo: https://github.com/pycqa/isort
rev: "5.10.1"
rev: "5.12.0"
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: "22.8.0"
rev: "23.3.0"
hooks:
- id: black
1 change: 0 additions & 1 deletion django_countries/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ def self_generate(

# Sort countries.
def sort_key(row):

return (
unicodedata.normalize("NFKD", row[0])
.encode("ascii", "ignore")
Expand Down
1 change: 0 additions & 1 deletion django_countries/tests/test_countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ def test_translation_fallback_override_names(self):
}
}
):

lang = translation.get_language()
try:
translation.activate("eo")
Expand Down
1 change: 0 additions & 1 deletion django_countries/tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class TestCountriesTags(TestCase):

TEMPLATE_COUNTRY = Template(
"{% load countries %}{% get_country code as country %}{{ country }}"
)
Expand Down