Skip to content

Commit b7fbc12

Browse files
Enable FIX002 and check alphabetical sort of ALL_TOOLS (#496)
1 parent 81455a1 commit b7fbc12

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ lint.select = [
9797
"EM",
9898
"ERA",
9999
"F",
100-
# "FIX002",
100+
"FIX002",
101101
"FURB",
102102
"I",
103103
"INP",

src/usethis/_core/author.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
# TODO can we default to git info?
2-
# TODO neither name or email is strictly required, but at least one is.
3-
4-
51
from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager
62
from usethis._integrations.uv.init import ensure_pyproject_toml
73

84

95
def add_author(
106
*,
7+
# Strictly, a name is not required by the TOML spec, but we do require it
118
name: str,
129
email: str | None = None,
1310
overwrite: bool = False,

src/usethis/_tool.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,4 +1563,3 @@ def _ensure_exists(file_manager: KeyValueFileManager) -> None:
15631563
RequirementsTxtTool(),
15641564
RuffTool(),
15651565
]
1566-
# TODO test that the list is sorted alphabetically by CLI name

tests/usethis/test_usethis_tool.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from usethis._integrations.uv.deps import Dependency, add_deps_to_group
1313
from usethis._test import change_cwd
1414
from usethis._tool import (
15+
ALL_TOOLS,
1516
ConfigEntry,
1617
ConfigItem,
1718
ConfigSpec,
@@ -1370,3 +1371,9 @@ def test_no_rules(self, tmp_path: Path):
13701371

13711372
# Assert
13721373
assert RuffTool().get_ignored_rules() == ["A"]
1374+
1375+
1376+
class TestAllTools:
1377+
def test_sorted_alphabetically(self):
1378+
names = [tool.name.lower() for tool in ALL_TOOLS]
1379+
assert names == sorted(names)

0 commit comments

Comments
 (0)