Skip to content

Commit

Permalink
Merge cd543c9 into 8f95162
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasTanz committed Feb 18, 2024
2 parents 8f95162 + cd543c9 commit fc22d15
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 25 deletions.
22 changes: 9 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ include = [
# from `tests` so the root directory must be added to Python's path for editable installations
dev-mode-dirs = ["."]

# Black section
# Read more here: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
[tool.black]
# Ruff section
# Read more here: https://docs.astral.sh/ruff/linter/#rule-selection
[tool.ruff]
line-length=80

# Isort section
# Read more here: https://pycqa.github.io/isort/docs/configuration/config_files.html
[tool.isort]
profile="black"
line_length=80
known_first_party = ["tuf"]
[tool.ruff.lint]
ignore = ["D400","D415","D213","D205","D202","D107","D407","D413","D212","D104","D406","D105","D411","D401","D200","D203"]

[tool.ruff.lint.per-file-ignores]
"tuf/repository/__init__.py" = ["F401"]
"tuf/api/exceptions.py" = ["F401"]

# Pylint section

Expand Down Expand Up @@ -156,7 +156,3 @@ module = [
"securesystemslib.*",
]
ignore_missing_imports = "True"

[tool.pydocstyle]
inherit = false
ignore = "D400,D415,D213,D205,D202,D107,D407,D413,D212,D104,D406,D105,D411,D401,D200,D203"
4 changes: 1 addition & 3 deletions requirements/lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
# Lint tools
# (We are not so interested in the specific versions of the tools: the versions
# are pinned to prevent unexpected linting failures when tools update)
black==24.2.0
isort==5.13.2
pylint==3.0.3
ruff==0.2.1
mypy==1.8.0
bandit==1.7.7
pydocstyle==6.3.0
6 changes: 3 additions & 3 deletions tests/test_updater_top_level_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ def test_new_targets_hash_mismatch(self) -> None:
# Modify targets contents without updating
# snapshot's targets hashes
self.sim.targets.version += 1
self.sim.snapshot.meta["targets.json"].version = (
self.sim.targets.version
)
self.sim.snapshot.meta[
"targets.json"
].version = self.sim.targets.version
self.sim.snapshot.version += 1
self.sim.update_timestamp()

Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run_sub_tests_with_dataset(
cases in dataset"""

def real_decorator(
function: Callable[[unittest.TestCase, Any], None]
function: Callable[[unittest.TestCase, Any], None],
) -> Callable[[unittest.TestCase], None]:
def wrapper(test_cls: unittest.TestCase) -> None:
for case, data in dataset.items():
Expand Down
8 changes: 3 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ deps =
--editable {toxinidir}
lint_dirs = tuf examples tests verify_release
commands =
black --check --diff {[testenv:lint]lint_dirs}
isort --check --diff {[testenv:lint]lint_dirs}
ruff check --diff {[testenv:lint]lint_dirs}
ruff format --diff {[testenv:lint]lint_dirs}
pylint -j 0 --rcfile=pyproject.toml {[testenv:lint]lint_dirs}

mypy {[testenv:lint]lint_dirs}

bandit -r tuf

pydocstyle tuf

[testenv:docs]
deps =
-r{toxinidir}/requirements/docs.txt
Expand Down

0 comments on commit fc22d15

Please sign in to comment.