Skip to content
This repository was archived by the owner on Sep 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@db9987b4c1f10f0404fa60ee629f675fafbd6763
with:
python-version: 3.13
# Black targets py314; its safety check requires running on >= that version
python-version: 3.14
- name: Install dependencies
run: |
pip install -U pip
Expand Down
152 changes: 101 additions & 51 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ documentation = "https://tartufo.readthedocs.io/"

[dependency-groups]
dev = [
"black>=24.4.2",
"black>=26.3.1",
"coverage[toml]>=7.2.2",
"mypy>=1.11.0",
"pre-commit",
"pylint>=3.2.6",
"pytest>=8.3.2",
"pytest>=9.0.3",
"pytest-cov>=5.0.0",
"pytest-sugar>=1.0.0",
"tox>=4.16.0",
Expand Down
1 change: 0 additions & 1 deletion tartufo/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from tartufo import cli


if __name__ == "__main__":
cli.main() # pylint: disable=no-value-for-parameter
1 change: 0 additions & 1 deletion tartufo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from tartufo import config, scanner, types, util


PLUGIN_DIR = pathlib.Path(__file__).parent / "commands"
PLUGIN_MODULE = "tartufo.commands"

Expand Down
4 changes: 1 addition & 3 deletions tartufo/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ def load_config(self, config_path: str) -> None:
return
# Look for usable configuration file
try:
(config_file, data) = config.load_config_from_path(
pathlib.Path(config_path)
)
config_file, data = config.load_config_from_path(pathlib.Path(config_path))
except (FileNotFoundError, types.ConfigException):
# Nothing usable found; nothing to do
return
Expand Down
1 change: 0 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from tests import helpers
from tests.commands import foo as command_foo


FakeFile = namedtuple("FakeFile", ["name"])


Expand Down
10 changes: 5 additions & 5 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ def setUp(self):
return super().setUp()

def test_pyproject_toml_is_discovered_if_present(self):
(config_path, _) = config.load_config_from_path(self.data_dir)
config_path, _ = config.load_config_from_path(self.data_dir)
self.assertEqual(config_path, self.data_dir / "pyproject.toml")

def test_tartufo_toml_is_discovered_if_present(self):
(config_path, _) = config.load_config_from_path(self.data_dir / "config")
config_path, _ = config.load_config_from_path(self.data_dir / "config")
self.assertEqual(config_path, self.data_dir / "config" / "tartufo.toml")

def test_prefer_tartufo_toml_config_if_both_are_present(self):
(config_path, _) = config.load_config_from_path(self.data_dir / "multiConfig")
config_path, _ = config.load_config_from_path(self.data_dir / "multiConfig")
self.assertEqual(config_path, self.data_dir / "multiConfig" / "tartufo.toml")

def test_specified_file_gets_read(self):
(config_path, _) = config.load_config_from_path(
config_path, _ = config.load_config_from_path(
self.data_dir / "config", "other_config.toml"
)
self.assertEqual(config_path, self.data_dir / "config" / "other_config.toml")
Expand All @@ -192,7 +192,7 @@ def test_config_exception_is_raised_if_trouble_reading_file(
@mock.patch("tomlkit.loads")
def test_config_keys_are_normalized(self, mock_load: mock.MagicMock):
mock_load.return_value = {"tool": {"tartufo": {"--repo-path": "."}}}
(_, data) = config.load_config_from_path(self.data_dir)
_, data = config.load_config_from_path(self.data_dir)
self.assertEqual(data, {"repo_path": "."})


Expand Down
6 changes: 2 additions & 4 deletions tests/test_update_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,13 @@ def test_replace_deprecated_signatures(self) -> None:

def test_write_updated_signatures(self) -> None:
file_name = Path("test.toml")
initial_file_content = textwrap.dedent(
"""[tool.tartufo]
initial_file_content = textwrap.dedent("""[tool.tartufo]
exclude-signatures = [
{signature = '123'},
{signature = '456'},
{signature = '789'}
]
"""
)
""")

expected_deprecations: Set[Sequence[str]] = set()
expected_deprecations.update((("123", "abc"), ("456", "def"), ("789", "ghi")))
Expand Down
11 changes: 6 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,29 @@ commands =

[testenv:black]
skip_install = true
basepython = python3.13
basepython = python3.14
commands =
poetry env use {envpython}
poetry install --no-root --with dev -v
poetry run black --check .

[testenv:mypy]
skip_install = true
basepython = python3.13
basepython = python3.14
commands =
poetry install --no-root --with dev -v
poetry run mypy .

[testenv:pylint]
skip_install = true
basepython = python3.13
basepython = python3.14
commands =
poetry install --no-root --with dev -v
poetry run pylint scripts/ tartufo/ tests/

[testenv:vulture]
skip_install = true
basepython = python3.13
basepython = python3.14
commands =
poetry install --no-root --with dev -v
poetry run vulture --min-confidence 70 \
Expand All @@ -61,7 +62,7 @@ commands =

[testenv:docs]
skip_install = true
basepython = python3.13
basepython = python3.14
commands =
poetry install --no-root --with docs -v
poetry run make -C docs clean html spelling
Loading