-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
225 additions
and
148 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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
coverage | ||
pytest | ||
pytest-plus | ||
pytest-xdist |
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 |
---|---|---|
|
@@ -3,10 +3,7 @@ ci: | |
# format compatible with commitlint | ||
autoupdate_commit_msg: "chore: pre-commit autoupdate" | ||
autoupdate_schedule: monthly | ||
autofix_commit_msg: | | ||
chore: auto fixes from pre-commit.com hooks | ||
for more information, see https://pre-commit.ci | ||
autofix_commit_msg: "chore: auto fixes from pre-commit.com hooks" | ||
skip: | ||
# https://github.com/pre-commit-ci/issues/issues/55 | ||
- pip-compile | ||
|
@@ -15,16 +12,15 @@ repos: | |
- repo: meta | ||
hooks: | ||
- id: check-useless-excludes | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
- repo: https://github.com/rbubley/mirrors-prettier | ||
# keep it before yamllint | ||
rev: v4.0.0-alpha.8 | ||
rev: v3.4.2 | ||
hooks: | ||
- id: prettier | ||
always_run: true | ||
additional_dependencies: | ||
- prettier | ||
- prettier-plugin-toml | ||
- prettier-plugin-sort-json | ||
- [email protected] | ||
- [email protected] | ||
- repo: https://github.com/streetsidesoftware/cspell-cli | ||
rev: v8.17.2 | ||
hooks: | ||
|
@@ -39,6 +35,11 @@ repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks.git | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: debug-statements | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
|
@@ -64,24 +65,33 @@ repos: | |
files: \.(yaml|yml)$ | ||
types: [file, yaml] | ||
entry: yamllint --strict | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 6.0.0 | ||
hooks: | ||
- id: isort | ||
args: | ||
# https://github.com/pre-commit/mirrors-isort/issues/9#issuecomment-624404082 | ||
- --filter-files | ||
- repo: https://github.com/psf/black | ||
rev: 25.1.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
- repo: https://github.com/asottile/pyupgrade | ||
# keep it after flake8 | ||
rev: v3.19.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py39-plus"] | ||
- repo: https://github.com/pappasam/toml-sort | ||
rev: v0.24.2 | ||
hooks: | ||
- id: toml-sort-fix | ||
alias: toml | ||
|
||
- repo: https://github.com/tox-dev/tox-ini-fmt | ||
rev: 1.5.0 | ||
hooks: | ||
- id: tox-ini-fmt | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.9.4 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix | ||
- --exit-non-zero-on-fix | ||
types_or: [python, pyi] | ||
# - id: ruff-format # must be after ruff | ||
# types_or: [python, pyi] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.14.1 | ||
hooks: | ||
|
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,10 @@ | ||
[formatting] | ||
# cspell: disable-next-line | ||
# compatibility between toml-sort-fix pre-commit hook and panekj.even-betterer-toml extension | ||
align_comments = false | ||
array_trailing_comma = false | ||
compact_arrays = true | ||
compact_entries = false | ||
compact_inline_tables = true | ||
inline_table_expand = false | ||
reorder_keys = true |
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,8 @@ | ||
--- | ||
comment: false | ||
coverage: | ||
status: | ||
patch: true | ||
project: | ||
default: | ||
threshold: 0.5% |
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 |
---|---|---|
@@ -1,20 +1,12 @@ | ||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration | ||
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme | ||
|
||
"setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration and editable installs | ||
"setuptools_scm[toml] >= 7.0.5" # required for "no-local-version" scheme | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
requires-python = ">=3.10" | ||
dynamic = ["version", "dependencies", "optional-dependencies"] | ||
name = "mkdocs-ansible" | ||
description = "Ansible MkDocs Theme based on mkdocs-material" | ||
readme = "docs/README.md" | ||
authors = [{ "name" = "Ansible by Red Hat", "email" = "[email protected]" }] | ||
maintainers = [{ "name" = "Ansible by Red Hat", "email" = "[email protected]" }] | ||
license = { text = "MIT" } | ||
authors = [{"email" = "[email protected]", "name" = "Ansible by Red Hat"}] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
|
@@ -28,39 +20,61 @@ classifiers = [ | |
'Programming Language :: Python :: 3.13', | ||
"Topic :: Documentation", | ||
"Topic :: Software Development :: Documentation", | ||
"Topic :: Text Processing :: Markup :: HTML", | ||
"Topic :: Text Processing :: Markup :: HTML" | ||
] | ||
description = "Ansible MkDocs Theme based on mkdocs-material" | ||
dynamic = ["version", "dependencies", "optional-dependencies"] | ||
keywords = ["ansible", "mkdocs", "theme"] | ||
license = {text = "MIT"} | ||
maintainers = [{"email" = "[email protected]", "name" = "Ansible by Red Hat"}] | ||
name = "mkdocs-ansible" | ||
readme = "docs/README.md" | ||
requires-python = ">=3.10" | ||
|
||
[project.entry-points."mkdocs.themes"] | ||
ansible = "mkdocs_ansible" | ||
|
||
[project.urls] | ||
homepage = "https://github.com/ansible/mkdocs-ansible" | ||
changelog = "https://github.com/ansible/mkdocs-ansible/releases" | ||
documentation = "https://ansible.readthedocs.io/projects/mkdocs-ansible/" | ||
homepage = "https://github.com/ansible/mkdocs-ansible" | ||
repository = "https://github.com/ansible/mkdocs-ansible" | ||
changelog = "https://github.com/ansible/mkdocs-ansible/releases" | ||
|
||
[tool.codespell] | ||
# indention is a typo in ruamel.yaml's API | ||
ignore-words-list = "indention" | ||
skip = ".tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata" | ||
|
||
[project.entry-points."mkdocs.themes"] | ||
ansible = "mkdocs_ansible" | ||
# Keep this default because xml/report do not know to use load it from config file: | ||
# data_file = ".coverage" | ||
[tool.coverage.paths] | ||
source = ["src", ".tox/*/site-packages"] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"] | ||
omit = ["test/*", "src/mkdocs_ansible/_version.py"] | ||
exclude_also = ["pragma: no cover", "if TYPE_CHECKING:"] | ||
# Increase it just so it would pass on any single-python run | ||
fail_under = 82 | ||
skip_covered = true | ||
skip_empty = true | ||
# During development we might remove code (files) with coverage data, and we dont want to fail: | ||
ignore_errors = true | ||
omit = ["test/*", "src/mkdocs_ansible/_version.py"] | ||
show_missing = true | ||
skip_covered = true | ||
skip_empty = true | ||
|
||
[tool.coverage.run] | ||
concurrency = ["multiprocessing", "thread"] | ||
# Do not use branch until bug is fixes: | ||
# https://github.com/nedbat/coveragepy/issues/605 | ||
# branch = true | ||
parallel = true | ||
source = ["src"] | ||
|
||
[tool.mypy] | ||
strict = true | ||
exclude = "(.config|build|dist|test/local-content|site-packages|~/.pyenv|examples/playbooks/collections|plugins/modules)" | ||
# https://github.com/python/mypy/issues/12664 | ||
python_version = "3.10" | ||
strict = true | ||
warn_unused_configs = true | ||
exclude = ['build'] | ||
|
||
[[tool.mypy.overrides]] | ||
module = ["mkdocs_ansible._version"] | ||
|
@@ -73,19 +87,46 @@ warn_unused_ignores = false # https://github.com/python/mypy/issues/13201 | |
[tool.pylint.MASTER] | ||
ignore-paths = "^src/.*/(_version|_vendor).*$" | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = { file = [".config/requirements.in"] } | ||
optional-dependencies.test = { file = [".config/requirements-test.in"] } | ||
[tool.ruff] | ||
cache-dir = "./.cache/.ruff" | ||
exclude = [".config"] | ||
fix = true | ||
# Same as Black. | ||
line-length = 88 | ||
preview = true | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "google" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = [".config/requirements.in"]} | ||
optional-dependencies.test = {file = [".config/requirements-test.in"]} | ||
|
||
[tool.setuptools.package-data] | ||
"*" = ["*.css", "*.html", "*.js"] | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.setuptools_scm] | ||
# To prevent accidental pick of mobile version tags such 'v6' | ||
git_describe_command = [ | ||
"git", | ||
"describe", | ||
"--dirty", | ||
"--long", | ||
"--tags", | ||
"--match", | ||
"v*.*" | ||
] | ||
local_scheme = "no-local-version" | ||
tag_regex = "^(?P<prefix>v)?(?P<version>\\d+[^\\+]*)(?P<suffix>.*)?$" | ||
write_to = "src/mkdocs_ansible/_version.py" | ||
|
||
[tool.tomlsort] | ||
in_place = true | ||
sort_inline_tables = true | ||
sort_table_keys = true |
Oops, something went wrong.