Skip to content

Commit

Permalink
ci: remove pylint and use ruff pylint rules instead
Browse files Browse the repository at this point in the history
This replaces pylint with the ruff pylint rules for conventions (PLC),
errors (PLE), and warnings (PLW). The pylint refactoring rules (PLR)
were left out since they are extraneous, and as the name implies,
require heavy refactoring. See Ruff's pylint rules for more info. [1]

Also, bumped ruff version from 0.4.4 to 0.5.0

Refs:
[1] https://docs.astral.sh/ruff/rules/#pylint-pl
  • Loading branch information
a-dubs committed Feb 24, 2025
1 parent 5a787ae commit 4ce75b3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 35 deletions.
18 changes: 0 additions & 18 deletions .pylintrc

This file was deleted.

4 changes: 2 additions & 2 deletions examples/lxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def basic_lifecycle():
print(inst.ephemeral)
print(inst.state)

inst = lxd.get_instance(name)
inst.delete()
same_instance_retrieved = lxd.get_instance(name)
same_instance_retrieved.delete()


def launch_virtual_machine():
Expand Down
2 changes: 1 addition & 1 deletion pycloudlib/qemu/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def get_free_port():
"""Look for a free local port for SSHing to VM."""
global next_port # pylint: disable=global-statement
global next_port # noqa: PLW0603
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
for port in range(next_port, next_port + 100):
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ docstring-code-format = true
extend-select = [
"D", # pydocstyle
"I", # isort
"PLC", # Pylint conventions
"PLE", # Pylint errors
"PLW", # Pylint warnings
]

[tool.ruff.lint.pydocstyle]
Expand Down
16 changes: 2 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[tox]
# As it may be undesired to make formatting changes, by default only check
envlist = ruff, format-check, mypy, pylint, py38
envlist = ruff, format-check, mypy, py38
skipsdist = true

[common]
envdir = {toxworkdir}/.testenv
deps =
mypy==0.950
pylint==3.1.0
ruff==0.4.3
ruff==0.5.0
types-mock==5.0.0
types-pyyaml==6.0.12
types-requests==2.31.0.6
Expand Down Expand Up @@ -51,11 +50,6 @@ envdir = {[common]envdir}
deps = {[common]deps}
commands = {envpython} -m ruff check -- pycloudlib examples setup.py

[testenv:pylint]
envdir = {[common]envdir}
deps = {[common]deps}
commands = {envpython} -m pylint --max-line-length=100 pycloudlib examples setup.py

[testenv:format-check]
envdir = {[common]envdir}
deps = {[common]deps}
Expand All @@ -81,15 +75,9 @@ commands = sphinx-build -M html "." "_build" -W
[tip]
envdir = {toxworkdir}/.testenv-tip
deps =
pylint
ruff
-rrequirements.txt

[testenv:tip-pylint]
envdir = {[tip]envdir}
deps = {[tip]deps}
commands = {envpython} -m pylint --max-line-length=100 pycloudlib examples setup.py

[testenv:tip-ruff]
envdir = {[tip]envdir}
deps = {[tip]deps}
Expand Down

0 comments on commit 4ce75b3

Please sign in to comment.