Skip to content

Commit

Permalink
Merge pull request #26 from CourtBouillon/ruff
Browse files Browse the repository at this point in the history
Use ruff instead of flake8 and isort
  • Loading branch information
liZe authored Apr 24, 2024
2 parents 5c8e417 + 488c839 commit fef52da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,4 @@ jobs:
- name: Launch tests
run: python -m pytest
- name: Check coding style
run: python -m flake8
- name: Check imports order
run: python -m isort . --check --diff
run: python -m ruff check
9 changes: 3 additions & 6 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@ You can launch tests using the following command::

venv/bin/pytest

WeasyPrint also uses isort_ to check imports and flake8_ to check the coding
style::
pydyf also uses ruff_ to check the coding style::

venv/bin/python -m isort . --check --diff
venv/bin/python -m flake8
venv/bin/python -m ruff check

.. _pytest: https://docs.pytest.org/
.. _Ghostscript: https://www.ghostscript.com/
.. _isort: https://pycqa.github.io/isort/
.. _flake8: https://flake8.pycqa.org/
.. _ruff: https://docs.astral.sh/ruff/


Documentation
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Donation = 'https://opencollective.com/courtbouillon'

[project.optional-dependencies]
doc = ['sphinx', 'sphinx_rtd_theme']
test = ['pytest', 'isort', 'flake8', 'pillow']
test = ['pytest', 'ruff', 'pillow']

[tool.flit.sdist]
exclude = ['.*']
Expand All @@ -52,6 +52,6 @@ include = ['tests/*', 'pydyf/*']
exclude_lines = ['pragma: no cover', 'def __repr__', 'raise NotImplementedError']
omit = ['.*']

[tool.isort]
default_section = 'FIRSTPARTY'
multi_line_output = 4
[tool.ruff.lint]
select = ['E', 'W', 'F', 'I', 'N', 'RUF']
ignore = ['RUF001', 'RUF002', 'RUF003']

0 comments on commit fef52da

Please sign in to comment.