Skip to content

Commit

Permalink
lint: fix ruff suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytelife26 committed Jan 25, 2024
1 parent 64bb526 commit fc5e10a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion proselint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from .config_paths import proselint_path as path
from .logger import log

__all__ = ["tools", "log", "checks", "path", "config_default"]
__all__ = ["checks", "config_default", "log", "path", "tools"]
2 changes: 1 addition & 1 deletion proselint/checks/links/broken.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def check(text: str) -> list[ResultCheck]:
|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+
|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)
|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019\u21a9]))""",
re.U | re.X,
re.UNICODE | re.VERBOSE,
)

results: list[ResultCheck] = []
Expand Down
7 changes: 3 additions & 4 deletions tests/test_config_flag.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Test user option overrides using --config and load_options"""
import json
import os
from pathlib import Path
from unittest.mock import patch

Expand Down Expand Up @@ -33,7 +32,7 @@ def test_load_options_function(isfile):
assert default["checks"]["uncomparables.misc"]
assert not overrides["checks"]["uncomparables.misc"]

isfile.side_effect = os.path.join(os.getcwd(), ".proselintrc.json").__eq__
isfile.side_effect = (Path.cwd() / ".proselintrc.json").__eq__

def test_config_flag_demo():
"""Test the --config CLI argument"""
Expand All @@ -42,7 +41,7 @@ def test_config_flag_demo():
assert "uncomparables.misc" in result.stdout

def test_config_flag_config():
result = CliRunner().invoke(proselint, ["--demo", "-v"] + FLAG)
result = CliRunner().invoke(proselint, ["--demo", "-v", *FLAG])
print_invoke_return(result)
assert "uncomparables.misc" not in result.stdout

Expand All @@ -69,6 +68,6 @@ def test_dump_config():
if triggered, the input-cfg was extended with the default-config
-> add missing flags to input-cfg!
"""
output = CliRunner().invoke(proselint, ["--dump-config"] + FLAG)
output = CliRunner().invoke(proselint, ["--dump-config", *FLAG])
assert json.loads(output.stdout) == json.load(CONFIG_FILE.open())

1 change: 0 additions & 1 deletion tests/test_invalid_chars.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from proselint.command_line import proselint
from tests.conftest import print_invoke_return


CHAR_FILE = Path(__file__, "../invalid-chars.txt").resolve()

def test_invalid_characters():
Expand Down

0 comments on commit fc5e10a

Please sign in to comment.