-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add copier template for pre-commit and lint codebase (#3)
- Loading branch information
1 parent
701e00d
commit d0ed157
Showing
4 changed files
with
96 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: 418d39a | ||
_src_path: https://github.com/westerveltco/pre-commit-template | ||
django_version: 3.2 | ||
include_django: true | ||
include_javascript: false | ||
include_python: true | ||
include_tailwind: false | ||
python_version: 3.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ requires = ["hatchling"] | |
|
||
[project] | ||
authors = [ | ||
{name = "Josh Thomas", email = "[email protected]"}, | ||
{name = "Josh Thomas", email = "[email protected]"} | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
|
@@ -24,13 +24,13 @@ classifiers = [ | |
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: CPython" | ||
] | ||
dependencies = ["django>=3.2"] | ||
description = "A simple, flexible, and extensible navigation menu for Django." | ||
dynamic = ["version"] | ||
keywords = [] | ||
license = "MIT" | ||
license = {file = "LICENSE"} | ||
name = "django-simple-nav" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
|
@@ -49,7 +49,7 @@ dev = [ | |
"pytest-django", | ||
"pytest-randomly", | ||
"pytest-reverse", | ||
"pytest-xdist", | ||
"pytest-xdist" | ||
] | ||
docs = [ | ||
"cogapp", | ||
|
@@ -58,7 +58,7 @@ docs = [ | |
"sphinx", | ||
"sphinx-autobuild", | ||
"sphinx-copybutton", | ||
"sphinx-inline-tabs", | ||
"sphinx-inline-tabs" | ||
] | ||
lint = ["pre-commit"] | ||
|
||
|
@@ -67,37 +67,20 @@ Documentation = "https://django-simple-nav.westervelt.dev" | |
Issues = "https://github.com/westerveltco/django-simple-nav/issues" | ||
Source = "https://github.com/westerveltco/django-simple-nav" | ||
|
||
[tool.hatch.build] | ||
exclude = [ | ||
".github/*", | ||
".dockerfiles/*", | ||
".dockerignore", | ||
".editorconfig", | ||
".pre-commit-config.yaml", | ||
"Justfile", | ||
"src/service/*", | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/simple_nav"] | ||
|
||
[tool.hatch.version] | ||
path = "src/simple_nav/__init__.py" | ||
|
||
[tool.bumpver] | ||
commit = true | ||
commit_message = ":bookmark: bump version {old_version} -> {new_version}" | ||
current_version = "0.1.0dev0" | ||
push = false # set to false for CI | ||
push = false # set to false for CI | ||
tag = false | ||
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" | ||
|
||
[tool.bumpver.file_patterns] | ||
"src/simple_nav/__init__.py" = [ | ||
'__version__ = "{version}"', | ||
'__version__ = "{version}"' | ||
] | ||
"tests/test_version.py" = [ | ||
'assert __version__ == "{version}"', | ||
'assert __version__ == "{version}"' | ||
] | ||
|
||
[tool.coverage.paths] | ||
|
@@ -109,22 +92,39 @@ fail_under = 85 | |
[tool.coverage.run] | ||
omit = [ | ||
"src/simple_nav/migrations/*", | ||
"tests/*", | ||
"tests/*" | ||
] | ||
source = ["simple_nav"] | ||
|
||
[tool.django-stubs] | ||
django_settings_module = "tests.settings" | ||
strict_settings = false | ||
|
||
[tool.hatch.build] | ||
exclude = [ | ||
".github/*", | ||
".dockerfiles/*", | ||
".dockerignore", | ||
".editorconfig", | ||
".pre-commit-config.yaml", | ||
"Justfile", | ||
"src/service/*" | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/simple_nav"] | ||
|
||
[tool.hatch.version] | ||
path = "src/simple_nav/__init__.py" | ||
|
||
[tool.mypy] | ||
check_untyped_defs = true | ||
exclude = "docs/.*\\.py$" | ||
mypy_path = "src/" | ||
namespace_packages = false | ||
check_untyped_defs = true | ||
no_implicit_optional = true | ||
plugins = [ | ||
"mypy_django_plugin.main", | ||
"mypy_django_plugin.main" | ||
] | ||
warn_redundant_casts = true | ||
warn_unused_configs = true | ||
|
@@ -139,27 +139,16 @@ module = "tests.*" | |
ignore_missing_model_attributes = true | ||
|
||
[tool.pytest.ini_options] | ||
django_find_project = false | ||
pythonpath = "src" | ||
addopts = "--create-db -n auto --dist loadfile --doctest-modules" | ||
django_find_project = false | ||
norecursedirs = ".* bin build dist *.egg htmlcov logs node_modules templates venv" | ||
python_files = "tests.py test_*.py *_tests.py" | ||
pythonpath = "src" | ||
testpaths = ["tests"] | ||
|
||
[tool.ruff] | ||
ignore = ["E501", "E741"] # temporary | ||
select = [ | ||
"B", # flake8-bugbear | ||
"E", # Pycodestyle | ||
"F", # Pyflakes | ||
"I", # isort | ||
"UP", # pyupgrade | ||
] | ||
|
||
# Allow autofix for all enabled rules (when `--fix`) is provided. | ||
fixable = ["A", "B", "C", "D", "E", "F", "I"] | ||
unfixable = [] | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
# Exclude a variety of commonly ignored directories. | ||
exclude = [ | ||
".bzr", | ||
|
@@ -181,34 +170,34 @@ exclude = [ | |
"migrations", | ||
"node_modules", | ||
"static", | ||
"venv", | ||
"venv" | ||
] | ||
extend-include = ["*.pyi?"] | ||
|
||
per-file-ignores = {} | ||
|
||
# Allow autofix for all enabled rules (when `--fix`) is provided. | ||
fixable = ["A", "B", "C", "D", "E", "F", "I"] | ||
ignore = ["E501", "E741"] # temporary | ||
indent-width = 4 | ||
# Same as Black. | ||
line-length = 88 | ||
indent-width = 4 | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
|
||
per-file-ignores = {} | ||
select = [ | ||
"B", # flake8-bugbear | ||
"E", # Pycodestyle | ||
"F", # Pyflakes | ||
"I", # isort | ||
"UP" # pyupgrade | ||
] | ||
# Assume Python >3.8. | ||
target-version = "py38" | ||
unfixable = [] | ||
|
||
[tool.ruff.format] | ||
# Like Black, use double quotes for strings. | ||
quote-style = "double" | ||
|
||
# Like Black, indent with spaces, rather than tabs. | ||
indent-style = "space" | ||
|
||
# Like Black, respect magic trailing commas. | ||
# magic-trailing-comma = "respect" | ||
|
||
# Like Black, automatically detect the appropriate line ending. | ||
line-ending = "auto" | ||
# Like Black, use double quotes for strings. | ||
quote-style = "double" | ||
|
||
[tool.ruff.isort] | ||
force-single-line = true | ||
|