Skip to content

Commit

Permalink
Replace Pylint and Flake8 with Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
SkypLabs committed Nov 27, 2024
1 parent c91cd5c commit 01c618a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
15 changes: 7 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 8fe62d14e0b4d7d845a7022c5c2c3ae41bdd3f26 # frozen: v4.1.0
rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0
hooks:
- id: check-ast
- id: check-executables-have-shebangs
- id: check-yaml
- id: trailing-whitespace

- repo: https://github.com/pycqa/flake8
rev: cbeb4c9c4137cff1568659fcc48e8b85cddd0c8d # frozen: 4.0.1
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: e812d61e6e9d269f44ecda63904ed670a1948fe8 # frozen: v0.0.257
hooks:
- id: flake8
- id: ruff

- repo: https://github.com/pycqa/pylint
rev: eec287fae66f8fc514d5daa9caee46fd0e0cb6d9 # frozen: v2.12.2
- repo: https://github.com/pycqa/isort
rev: dbf82f2dd09ae41d9355bcd7ab69187a19e6bf2f # frozen: 5.12.0
hooks:
- id: pylint
- id: isort
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ install_requires =
where = src

[options.extras_require]
tests = flake8; pylint; tox
dev = isort; ruff
docs = Sphinx >= 3.2; sphinx_rtd_theme >= 0.5.0
tests = tox
45 changes: 24 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@
# and then run "tox" from this directory.

[tox]
envlist = py37, py38, py39, py310, flake8, pylint
skip_missing_interpreters = true
minversion = 3.0
minversion = 4.0
isolated_build = true
skip_missing_interpreters = true

envlist =
py37
py38
py39
py310
format
lint

[testenv]
description = "Faker Wi-Fi ESSID's unit tests"
description = "Run all tests"
commands =
{envpython} -m unittest discover -s tests
{envpython} -m unittest discover

[testenv:flake8]
description = "Check Faker Wi-Fi ESSID's code style & quality"
deps = flake8
[testenv:format]
description = "Run formatters"
skip_install = true
deps =
ruff
commands =
{envpython} -m flake8 src tests
ruff format src tests

[testenv:pylint]
description = "Check Faker Wi-Fi ESSID for programming errors"
deps = pylint
[testenv:lint]
description = "Run linters"
skip_install = true
deps =
ruff
commands =
{envpython} -m pylint src tests

[gh-actions]
description = "tox configuration when running on GitHub Actions"
python =
3.7: py37, flake8, pylint
3.8: py38, flake8, pylint
3.9: py39, flake8, pylint
3.10: py310, flake8, pylint
ruff check src tests

0 comments on commit 01c618a

Please sign in to comment.