Skip to content

Commit

Permalink
chore: replaced flake8 with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Oct 8, 2023
1 parent 12a3d9d commit e4b3010
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4

Expand Down
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ repos:
- id: trailing-whitespace
exclude: ^src/igrf_model/data/

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.275
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/pycqa/flake8
rev: 3.9.2 # pick a git hash / tag to point to
hooks:
- id: flake8
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ pytest = "^7.4.2"
pytest-cov = "^4.1.0"
coverage = {extras = ["toml"], version = "^7.3"}

[tool.ruff]
ignore = ["B905", "C901", "E402", "E501"]
line-length = 80
select = ["B", "C", "E", "F", "W"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion src/igrf_model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get(cls, version: int = 13):
try:
fp = open_text(_DATA_PACKAGE, f"igrf{version}.txt")
except Exception:
raise ValueError(f"unsupported model version: {version}")
raise ValueError(f"unsupported model version: {version}") from None
with fp:
instance = cls.from_io(fp)
cls._cache[version] = instance
Expand Down
4 changes: 0 additions & 4 deletions tox.ini

This file was deleted.

0 comments on commit e4b3010

Please sign in to comment.