Skip to content

Commit

Permalink
Update ruff config & usage (#37)
Browse files Browse the repository at this point in the history
* Update ruff to current version

* Make tox "style" and "quality" checks consistent

* Drop useful rule exclusion (experimental anyway)

* Apply style fixes
  • Loading branch information
dbarbuzzi authored Oct 4, 2024
1 parent fe91026 commit a55f344
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
19 changes: 12 additions & 7 deletions actions/testmo-create-resources/compose_testmo_resources_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,36 @@
import subprocess

if __name__ == "__main__":

# command line arguments
args_parser = argparse.ArgumentParser()

args_parser.add_argument(
"-j",
"--resources_json",
help="string version of JSON identifying resource fields",
type=str)
type=str,
)

args_parser.add_argument(
"-d",
"--destination",
help="absolute path for where to generate the file,",
type=str)
type=str,
)

args = args_parser.parse_args()
fields = json.loads(args.resources_json)

for field in fields:
testmo_args = [
"--resources", f"{args.destination}",
"--name", f"{field}",
"--type", "string",
"--value", f"{fields[field]}"
"--resources",
f"{args.destination}",
"--name",
f"{field}",
"--type",
"string",
"--value",
f"{fields[field]}",
]
testmo_command = ["npx", "testmo", "automation:resources:add-field"]
full_command = testmo_command + testmo_args
Expand Down
1 change: 0 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ ignore = [
"COM812",
"ISC001",
"TCH002",
"PLW1514", # allow Path.open without encoding
"S603"# https://github.com/astral-sh/ruff/issues/4045
]
select = [
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ env_list = py38,py39,py310,py311,py312
description = Run all quality checks
deps =
mypy~=1.10.1
ruff~=0.5.2
ruff~=0.6.9
mdformat~=0.7.17
mdformat-footnote~=0.1.1
mdformat-frontmatter~=2.0.8
mdformat-gfm~=0.3.6
yamlfix~=1.17.0
commands =
ruff format --check
ruff check
python -m mdformat --check README.md actions/
yamlfix --check --config-file .yamlfix.toml -i .github/**/*.yml -i .github/**/*.yaml -i actions/**/*.yml -i actions/**/*.yaml ./
Expand All @@ -22,7 +23,7 @@ commands =
description = Run style checks and fixes
deps =
mypy~=1.10.1
ruff~=0.5.2
ruff~=0.6.9
mdformat~=0.7.17
mdformat-footnote~=0.1.1
mdformat-frontmatter~=2.0.8
Expand Down

0 comments on commit a55f344

Please sign in to comment.