Skip to content

Commit

Permalink
Switch to using ruff for linting (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson authored Jan 31, 2023
1 parent 0573e0b commit 646e444
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ select = F, W, E101, E111, E112, E113, E401, E402, E501, E711, E722
max-line-length = 130
exclude =
docs,
ignore = E203, W503, W504, W605
extend-ignore = E203, W503, W504, W605
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ repos:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.207'
hooks:
- id: ruff
args: ["--fix", "--force-exclude"]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand All @@ -43,11 +49,6 @@ repos:
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: '6.0.0'
hooks:
- id: flake8

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Cleanup ``enum`` validation code. [#112]
- Add ``pre-commit`` support. [#119]
- Apply ``isort`` and ``black`` code formatters to all files. [#120]
- Switch from ``flake8`` to ``ruff`` for code linting. [#121]

0.14.0 (2022-11-14)
===================
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ force-exclude = '''
)/
)
'''

[tool.ruff]
line-length = 130
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/roman_datamodels/testing/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ def create_node(node_class, **kwargs):
`roman_datamodels.stnode.TaggedObjectNode`
"""
method_name = "create_" + _camel_case_to_snake_case(node_class.__name__)
if not method_name in globals():
if method_name not in globals():
raise ValueError(f"Factory method not implemented for class {node_class.__name__}")
return globals()[method_name](**kwargs)

Expand Down

0 comments on commit 646e444

Please sign in to comment.