Skip to content

Commit bbbf0cd

Browse files
authored
refactor: from flat layout to src layout (jxmorris12#193)
1 parent ff82f92 commit bbbf0cd

22 files changed

Lines changed: 5 additions & 13 deletions

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ repos:
1515
hooks:
1616
- id: mypy
1717
args: [--config-file=pyproject.toml]
18-
files: ^(language_tool_python|tests)/
1918

2019
# Standard pre-commit hooks
2120
- repo: https://github.com/pre-commit/pre-commit-hooks

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ test:
3434
uvx --with defusedxml genbadge coverage --input-file coverage.xml --silent
3535

3636
doc:
37-
uv run --group docs --locked sphinx-apidoc -o docs/source/references language_tool_python
3837
uv run --group docs --locked sphinx-build -M html docs/source docs/build
3938

4039
publish:

make.bat

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ uvx --with defusedxml genbadge coverage --input-file coverage.xml --silent
5757
exit /b %errorlevel%
5858

5959
:doc
60-
call uv run --group docs --locked sphinx-apidoc -o docs\source\references language_tool_python
61-
if errorlevel 1 exit /b %errorlevel%
62-
6360
call uv run --group docs --locked sphinx-build -M html docs/source docs/build
6461
exit /b %errorlevel%
6562

pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,9 @@ language_tool_python = "language_tool_python.__main__:main"
7272
requires = ["uv_build>=0.11.14,<0.12"]
7373
build-backend = "uv_build"
7474

75-
[tool.uv.build-backend]
76-
module-root = "" # uv expects the code to be in a "src/" directory by default, but our code is in the the current dir
77-
7875
[tool.ruff]
7976
line-length = 88
80-
include = ["language_tool_python/*.py", "tests/*.py"]
77+
include = ["src/**/*.py", "tests/**/*.py"]
8178

8279
[tool.ruff.lint]
8380
select = [
@@ -144,10 +141,10 @@ ignore = [
144141
"S101", # Need to use assert statements in tests
145142
"SLF001" # Need to use private members of the library for testing
146143
]
147-
"language_tool_python/__main__.py" = ["T201"] # Allow usage of print in the CLI entry point
144+
"src/language_tool_python/__main__.py" = ["T201"] # Allow usage of print in the CLI entry point
148145

149146
[tool.mypy]
150-
files = ["language_tool_python", "tests"]
147+
files = ["src", "tests"]
151148
disallow_any_decorated = true
152149
disallow_any_explicit = true
153150
disallow_any_expr = true

pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[pytest]
2-
addopts = -vra --cov=language_tool_python --cov-report=html --cov-report=xml
2+
addopts = -vra --cov=src --cov-report=html --cov-report=xml
33
testpaths = tests
44

55
[coverage:run]
6-
source = language_tool_python
6+
source = src
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)