Skip to content

Commit

Permalink
ci: Enables a couple ruff rules for CI
Browse files Browse the repository at this point in the history
`tox -e lint-weak-check` now runs with CI.

do `tox -e lint-weak-fix` to automatically perform any possible fixes to conform with this rule change.
  • Loading branch information
tazlin committed Apr 11, 2023
1 parent 60dc19d commit b4ebac6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ exclude=["comfy_controlnet_preprocessors", "facerestore"]
ignore=[
"E501", # XXX line too long (comments are the big offender right now)
"F401", # imported but unused
"E402", # Module level import not at top of file
"A002", # Argument `x` is shadowing a python builtin
"A001", # Variable `x` is shadowing a python builtin
"INP001", # ... is part of an implicit namespace package. Add an `__init__.py`.
]
select = [
"A", # flake8-builtins
Expand All @@ -95,8 +99,8 @@ select = [
"RSE", # flake8-raise
"RET", # flake8-return
# "SLF", # flake8-self
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
# "SIM", # flake8-simplify
# "ARG", # flake8-unused-arguments
# "TRY", # tryceratops
"RUF100"
]
Expand Down
20 changes: 17 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
env_list =
format
lint-weak-check
tests

[coverage:run]
Expand Down Expand Up @@ -50,12 +51,25 @@ deps =
skip_install = true
commands = ruff .

[testenv:sortimports]
description = check linting rules
[testenv:lint-weak-check]
description = check only certain few linting rules
deps =
ruff==0.0.261
skip_install = true
commands = ruff --select COM,I .

[testenv:lint-weak-fix]
description = fixes only certain few linting rules
deps =
black==22.3.0
ruff==0.0.261
skip_install = true
commands = ruff --fix --exclude comfy_horde.py --select I001 .
commands =
black .
ruff --fix --select COM,I .
black .
ruff --fix --select COM,I .


[testenv:comfyui]
description = run comfyui
Expand Down

0 comments on commit b4ebac6

Please sign in to comment.