Skip to content

Commit

Permalink
Add ruff linter (#506)
Browse files Browse the repository at this point in the history
* replace pyupgrade, autoflake, isort commit hooks with ruff

* add ruff config

* ruff . --fix

* pre-commit ruff ignore D and in tests,fw_tutorials at all times

* manual ruff fixes

* fix ambiguous variable names

* remove pydocstyle from CI

* fix test_mlaunch_report_version not checking ret_code
  • Loading branch information
janosh authored Aug 13, 2023
1 parent eee1caf commit d3d2ff0
Show file tree
Hide file tree
Showing 81 changed files with 906 additions and 1,168 deletions.
6 changes: 0 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
source activate test-environment
pip install .[workflow-checks,graph-plotting,flask-plotting]
pytest fireworks
echo "Checking code style..."
pycodestyle fireworks
echo "Done..."
pytest_pymongo4:
working_directory: ~/fireworks
Expand All @@ -54,9 +51,6 @@ jobs:
pip install --quiet -e .
pip install --quiet --upgrade pymongo
pytest fireworks
echo "Checking code style..."
pycodestyle fireworks
echo "Done..."
workflows:
version: 2
Expand Down
23 changes: 6 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
exclude: ^docs

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.284
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/PyCQA/autoflake
rev: v1.6.1
hooks:
- id: autoflake
- id: ruff
args: [--fix, --ignore, D]

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 23.7.0
hooks:
- id: black
args: [--line-length, '120']

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-symlinks
Expand Down
10 changes: 1 addition & 9 deletions fireworks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
# These imports allow a much simpler import of core Fireworks functionality.
# E.g., you can now do "from fireworks import Firework", instead of from
# "fireworks.core.firework import Firework".
from fireworks.core.firework import (
FiretaskBase,
FireTaskBase,
Firework,
FWAction,
Launch,
Tracker,
Workflow,
)
from fireworks.core.firework import FireTaskBase, FiretaskBase, Firework, FWAction, Launch, Tracker, Workflow
from fireworks.core.fworker import FWorker
from fireworks.core.launchpad import LaunchPad
from fireworks.user_objects.firetasks.fileio_tasks import (
Expand Down
Loading

0 comments on commit d3d2ff0

Please sign in to comment.