Skip to content

Commit

Permalink
Use ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Dec 30, 2023
1 parent 1e9de19 commit fac09f5
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion mscxyz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def execute(args: typing.Sequence = None):
files = list_scores(path=args.path, glob=args.general_glob)

for file in files:

print("\n" + color(file, "red"))

if args.general_backup:
Expand Down
4 changes: 1 addition & 3 deletions mscxyz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,7 @@ def list_fields(fields: typing.Sequence, prefix: str = "", suffix: str = "") ->
help="Show help. Use “{} help all” to show help \
messages of all subcommands. Use \
“{} help <subcommand>” to show only help messages \
for the given subcommand.".format(
parser.prog, parser.prog
),
for the given subcommand.".format(parser.prog, parser.prog),
)

sub_help.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion mscxyz/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def _split(field):
raise ValueError("Field “" + field + "” can’t be splitted!")
matches = match.groups()

if not matches[0] in InterfaceReadWrite.objects:
if matches[0] not in InterfaceReadWrite.objects:
raise ValueError(matches[0] + ": Not a supported object!")
return {"object": matches[0], "field": matches[1]}

Expand Down
1 change: 0 additions & 1 deletion mscxyz/rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def rename_filename(source: str) -> Meta:
show(source, target)

if not args.general_dry_run:

create_dir(target)
# Invalid cross-device link:
# os.rename(source, target)
Expand Down
1 change: 0 additions & 1 deletion mscxyz/score_file_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ def save(self, new_name: str = "", mscore: bool = False):
"//StaffText/text",
"//Jump/continueAt",
):

for tag in self.xml_tree.xpath(xpath):
if not tag.text:
tag.text = ""
Expand Down
1 change: 0 additions & 1 deletion mscxyz/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class DefaultArguments:

clean_style = None
export_extension = None
general_backup = False
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ lxml-stubs = "^0.4.0"
[tool.poetry.group.dev.dependencies]
readme-patcher = "^0.6.0"
tox = "^4.11.4"
black = "^22.6.0"
isort = "^5.10.1"
ruff = "^0.1.9"

[build-system]
requires = ["poetry>=1.2.0b2"]
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ passenv = XDG_RUNTIME_DIR

[testenv:format]
deps =
isort==5.10.1
black==22.6.0
ruff==0.1.9
commands =
isort .
black .
; sort imports
ruff check --select I --fix .
ruff format

[testenv:docs]
deps =
Expand All @@ -30,8 +30,8 @@ commands =

[testenv:lint]
deps =
flake8==4.0.1
commands = flake8 mscxyz tests
ruff==0.1.9
commands = ruff check

[gh-actions]
python =
Expand Down

0 comments on commit fac09f5

Please sign in to comment.