diff options
| author | omnom62 <omnom62@outlook.com> | 2026-03-20 21:50:38 +1000 |
|---|---|---|
| committer | omnom62 <omnom62@outlook.com> | 2026-03-20 21:50:38 +1000 |
| commit | ca1f501d63a2d76fb955846e79657677cf2c1e9d (patch) | |
| tree | 180c56c8990bb4eec1835dd8ba7dc5948ef3791e | |
| parent | 7599ba96bc3b659cb2a5f00b1be46ab6f55f48a6 (diff) | |
| download | rest.vyos-ca1f501d63a2d76fb955846e79657677cf2c1e9d.tar.gz rest.vyos-ca1f501d63a2d76fb955846e79657677cf2c1e9d.zip | |
precommit config
| -rw-r--r-- | .ansible-lint | 5 | ||||
| -rw-r--r-- | .flake8 | 67 | ||||
| -rw-r--r-- | .isort.cfg | 6 | ||||
| -rw-r--r-- | .prettierignore | 23 | ||||
| -rw-r--r-- | pyproject.toml | 7 |
5 files changed, 108 insertions, 0 deletions
diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..8d9bb70 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,5 @@ +--- +profile: production + +exclude_paths: + - changelogs/changelog.yaml @@ -0,0 +1,67 @@ +[flake8] + +builtins = _ + +# Print the total number of errors: +count = true + +# Don't even try to analyze these: +extend-exclude = + # No need to traverse egg info dir + *.egg-info, + # tool cache dirs + *_cache + # project env vars + .env, + # GitHub configs + .github, + # Cache files of MyPy + .mypy_cache, + # Cache files of pytest + .pytest_cache, + # Temp dir of pytest-testmon + .tmontmp, + # Occasional virtualenv dir + .venv + # VS Code + .vscode, + # Temporary build dir + build, + # This contains sdists and wheels of ansible-navigator that we don't want to check + dist, + # Metadata of `pip wheel` cmd is autogenerated + pip-wheel-metadata, + # adjacent venv + venv + # ansible won't let me + __init__.py + +# IMPORTANT: avoid using ignore option, always use extend-ignore instead +# Completely and unconditionally ignore the following errors: +extend-ignore = + F841, + # line-length + E501, + # module level import not at top of file + E402 + +# Accessibility/large fonts and PEP8 unfriendly: +max-line-length = 120 + +# Allow certain violations in certain files: +# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future +per-file-ignores = + # The following ignores have been researched and should be considered permanent + # each should be preceeded with an explanation of each of the error codes + # If other ignores are added for a specific file in the section following this, + # these will need to be added to that line as well. + + + # S101: Allow the use of assert within the tests directory, since tests require it. + tests/**.py: S101 + + # The following were present during the initial implementation. + # They are expected to be fixed and unignored over time. + +# Count the number of occurrences of each error/warning code and print a report: +statistics = true diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..c453632 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,6 @@ +[settings] +known_first_party=ansible_collections.vyos.vyos +line_length=100 +lines_after_imports=2 +lines_between_types=1 +profile=black diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..107bbd2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,23 @@ +# Stuff we don't want priettier to ever to look into +.*/ + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# A linked collection directory created by pytest-ansible-units + +collections/ + +# Tracked but not manually edited + +# Tracked but manually formatted + +# WIP +tests/integration/targets/vyos_config/templates/config.js +README.md diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fa4225f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[tool.black] +line-length = 100 + +[tool.pytest.ini_options] +addopts = ["-vvv", "-n", "2", "--log-level", "WARNING", "--color", "yes"] +testpaths = ["tests"] +filterwarnings = ['ignore:AnsibleCollectionFinder has already been configured'] |
