Skip to content

Commit

Permalink
Fix linting (#77)
Browse files Browse the repository at this point in the history
* remove black, fix lint

Signed-off-by: William Woodruff <[email protected]>

* drop isort

Signed-off-by: William Woodruff <[email protected]>

* drop old setting

Signed-off-by: William Woodruff <[email protected]>

---------

Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw authored Oct 27, 2023
1 parent 03aa054 commit f2bd6a9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 41 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ jobs:
with:
inputs: ./dist/*.tar.gz ./dist/*.whl
release-signing-artifacts: true
bundle-only: true
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ $(VENV_EXISTS): pyproject.toml
.PHONY: lint
lint: $(VENV_EXISTS)
. $(VENV_BIN)/activate && \
black --check $(ALL_PY_SRCS) && \
isort --check $(ALL_PY_SRCS) && \
ruff format --check $(ALL_PY_SRCS) && \
ruff $(ALL_PY_SRCS) && \
mypy $(PY_MODULE)
# TODO: Enable.
Expand All @@ -61,8 +60,7 @@ lint: $(VENV_EXISTS)
format: $(VENV_EXISTS)
. $(VENV_BIN)/activate && \
ruff --fix $(ALL_PY_SRCS) && \
black $(ALL_PY_SRCS) && \
isort $(ALL_PY_SRCS)
ruff format $(ALL_PY_SRCS)

.PHONY: test tests
test tests: $(VENV_EXISTS)
Expand Down
8 changes: 4 additions & 4 deletions abi3audit/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import sys
from collections import defaultdict
from typing import Any, DefaultDict
from typing import Any

from abi3info.models import PyVersion
from rich import traceback
Expand Down Expand Up @@ -87,9 +87,9 @@ def _ensure_pyversion(cls, version: str) -> PyVersion:
class SpecResults:
def __init__(self) -> None:
# Map of extractor -> shared object -> audit result
self._results: DefaultDict[Extractor, list[AuditResult]] = defaultdict(list)
self._bad_abi3_version_counts: DefaultDict[SharedObject, int] = defaultdict(int)
self._abi3_violation_counts: DefaultDict[SharedObject, int] = defaultdict(int)
self._results: defaultdict[Extractor, list[AuditResult]] = defaultdict(list)
self._bad_abi3_version_counts: defaultdict[SharedObject, int] = defaultdict(int)
self._abi3_violation_counts: defaultdict[SharedObject, int] = defaultdict(int)

def add(self, extractor: Extractor, so: SharedObject, result: AuditResult) -> None:
self._results[extractor].append(result)
Expand Down
37 changes: 5 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ dynamic = ["version"]
description = "Scans Python wheels for abi3 violations and inconsistencies"
readme = "README.md"
license = { file = "LICENSE" }
authors = [
{ name = "William Woodruff", email = "[email protected]" }
]
authors = [{ name = "William Woodruff", email = "[email protected]" }]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
Expand Down Expand Up @@ -39,35 +37,13 @@ Issues = "https://github.com/trailofbits/abi3audit/issues"
Source = "https://github.com/trailofbits/abi3audit"

[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"pretend",
"coverage[toml]",
]
lint = [
"bandit",
"black",
"isort",
"interrogate",
"mypy",
"ruff",
"types-requests",
]
dev = [
"build",
"pdoc3",
"abi3audit[test,lint]",
]
test = ["pytest", "pytest-cov", "pretend", "coverage[toml]"]
lint = ["bandit", "interrogate", "mypy", "ruff", "types-requests"]
dev = ["build", "pdoc3", "abi3audit[test,lint]"]

[project.scripts]
abi3audit = "abi3audit._cli:main"

[tool.isort]
multi_line_output = 3
known_first_party = "abi3audit"
include_trailing_comma = true

[tool.interrogate]
exclude = ["env", "test", "codegen"]
ignore-semiprivate = true
Expand All @@ -93,13 +69,10 @@ warn_unused_ignores = true
[tool.bandit]
exclude_dirs = ["./test"]

[tool.black]
line-length = 100

[tool.coverage.run]
omit = ["abi3audit/_vendor/*"]

[tool.ruff]
line-length = 100
select = ["E", "F", "W", "UP"]
select = ["E", "F", "I", "W", "UP"]
target-version = "py38"

0 comments on commit f2bd6a9

Please sign in to comment.