netdoc-collector 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. netdoc_collector-0.2.1/.editorconfig +33 -0
  2. netdoc_collector-0.2.1/.flake8 +8 -0
  3. netdoc_collector-0.2.1/.github/CODEOWNERS +3 -0
  4. netdoc_collector-0.2.1/.github/workflows/cd.yml +37 -0
  5. netdoc_collector-0.2.1/.github/workflows/ci.yml +77 -0
  6. netdoc_collector-0.2.1/.gitignore +420 -0
  7. netdoc_collector-0.2.1/.markdownlint.yaml +21 -0
  8. netdoc_collector-0.2.1/.pre-commit-config.yaml +93 -0
  9. netdoc_collector-0.2.1/.pylintrc +37 -0
  10. netdoc_collector-0.2.1/.release-please-manifest.json +3 -0
  11. netdoc_collector-0.2.1/.snyk +20 -0
  12. netdoc_collector-0.2.1/.vscode/settings.json +63 -0
  13. netdoc_collector-0.2.1/.yamlfmt +8 -0
  14. netdoc_collector-0.2.1/.yamllint.yaml +28 -0
  15. netdoc_collector-0.2.1/CONTRIBUTING.md +293 -0
  16. netdoc_collector-0.2.1/LICENSE +674 -0
  17. netdoc_collector-0.2.1/Makefile +32 -0
  18. netdoc_collector-0.2.1/PKG-INFO +79 -0
  19. netdoc_collector-0.2.1/README.md +52 -0
  20. netdoc_collector-0.2.1/config-example.yaml +13 -0
  21. netdoc_collector-0.2.1/poetry.lock +3426 -0
  22. netdoc_collector-0.2.1/pyproject.toml +223 -0
  23. netdoc_collector-0.2.1/release-please-config.json +15 -0
  24. netdoc_collector-0.2.1/src/netdoc_collector/__init__.py +0 -0
  25. netdoc_collector-0.2.1/src/netdoc_collector/__main__.py +5 -0
  26. netdoc_collector-0.2.1/src/netdoc_collector/core/ansible_inventory.py +88 -0
  27. netdoc_collector-0.2.1/src/netdoc_collector/core/tasks.py +48 -0
  28. netdoc_collector-0.2.1/src/netdoc_collector/core/utils.py +58 -0
  29. netdoc_collector-0.2.1/src/netdoc_collector/main.py +239 -0
  30. netdoc_collector-0.2.1/src/netdoc_collector/plugins/__init__.py +0 -0
  31. netdoc_collector-0.2.1/src/netdoc_collector/plugins/base.py +122 -0
  32. netdoc_collector-0.2.1/src/netdoc_collector/plugins/dispatcher.py +66 -0
  33. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_allied_telesis_awplus.py +51 -0
  34. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_aruba_oscx.py +66 -0
  35. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_cisco_ios.py +82 -0
  36. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_cisco_nxos.py +73 -0
  37. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_cisco_xr.py +76 -0
  38. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_hp_comware.py +65 -0
  39. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_hp_procurve.py +50 -0
  40. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_huawei_vrp.py +66 -0
  41. netdoc_collector-0.2.1/src/netdoc_collector/plugins/netmiko_linux.py +60 -0
  42. netdoc_collector-0.2.1/tests/test_netmiko_cisco_nxos.py +167 -0
@@ -0,0 +1,33 @@
1
+ # EditorConfig is awesome: https://editorconfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ # Unix-style newlines with a newline ending every file
7
+ [*]
8
+ end_of_line = lf
9
+ insert_final_newline = true
10
+
11
+ # Matches multiple files with brace expansion notation
12
+ # Set default charset
13
+ [*.{js,py}]
14
+ charset = utf-8
15
+
16
+ # 4 space indentation
17
+ [*.py]
18
+ indent_style = space
19
+ indent_size = 4
20
+
21
+ # Tab indentation (no size specified)
22
+ [Makefile]
23
+ indent_style = tab
24
+
25
+ # Indentation override for all JS under lib directory
26
+ [lib/**.js]
27
+ indent_style = space
28
+ indent_size = 2
29
+
30
+ # Matches the exact files either package.json or .travis.yml
31
+ [{package.json,.travis.yml}]
32
+ indent_style = space
33
+ indent_size = 2
@@ -0,0 +1,8 @@
1
+ [flake8]
2
+ exclude = __pycache__|.git|.venv|.vscode|build|dist|env|fonts|migrations|venv
3
+ # Ignore C901: Function is too complex
4
+ # Ignore E501: Line too long (82 > 79 characters)
5
+ # Ignore W503: Line break occurred before a binary operator
6
+ ignore = C901, E501, W503
7
+ max-complexity = 10
8
+ max-line-length = 120
@@ -0,0 +1,3 @@
1
+ # Default owner(s) of all files in this repository
2
+ * @AndreaCavazzini
3
+ * @dainok
@@ -0,0 +1,37 @@
1
+ name: Release (CD)
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+ outputs:
15
+ release_created: ${{ steps.release.outputs.release_created }}
16
+ steps:
17
+ - uses: googleapis/release-please-action@v5
18
+ id: release
19
+ with:
20
+ token: ${{ secrets.GITHUB_TOKEN }}
21
+ config-file: release-please-config.json
22
+ manifest-file: .release-please-manifest.json
23
+
24
+ publish:
25
+ needs: release
26
+ if: ${{ needs.release.outputs.release_created }}
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v6
30
+ - uses: actions/setup-python@v6
31
+ with: { python-version: "3.12" }
32
+ - run: pip install build twine
33
+ - run: python -m build
34
+ - run: twine upload dist/*
35
+ env:
36
+ TWINE_USERNAME: __token__
37
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,77 @@
1
+ name: Tests (CI)
2
+
3
+ env:
4
+ PYTHON_VERSION: 3.12
5
+
6
+ on:
7
+ pull_request:
8
+ types: [opened, synchronize, reopened]
9
+
10
+ # Cancel any existing runs of this workflow for this same branch
11
+ concurrency:
12
+ group: ci-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ tests:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Checkout
20
+ uses: actions/checkout@v6
21
+ with:
22
+ path: netdoc-collector
23
+
24
+ - name: Checkout backend
25
+ uses: actions/checkout@v6
26
+ with:
27
+ repository: NetDocLab/netdoc
28
+ path: netdoc
29
+ # Permission -> Content
30
+ token: ${{ secrets.NETDOC_REPO_TOKEN }}
31
+
32
+ - name: Setup Python3
33
+ uses: actions/setup-python@v6
34
+ with:
35
+ python-version: ${{ env.PYTHON_VERSION }}
36
+
37
+ - name: Install Poetry
38
+ run: pip install --no-cache-dir poetry
39
+ working-directory: netdoc-collector
40
+
41
+ - name: Display Poetry version
42
+ run: poetry --version
43
+ working-directory: netdoc-collector
44
+
45
+ - name: Configure Poetry
46
+ run: poetry config virtualenvs.in-project true
47
+ working-directory: netdoc-collector
48
+
49
+ - name: Install
50
+ run: make install
51
+ working-directory: netdoc-collector
52
+
53
+ - name: Code linting (make lint)
54
+ run: make lint
55
+ working-directory: netdoc-collector
56
+
57
+ - name: Run checks (pre-commit)
58
+ run: make check
59
+ working-directory: netdoc-collector
60
+
61
+ - name: Run tests
62
+ run: make coverage
63
+ working-directory: netdoc-collector
64
+
65
+ snyk:
66
+ needs: tests
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - name: Checkout
70
+ uses: actions/checkout@v6
71
+
72
+ - name: Setup Snyk
73
+ uses: snyk/actions/python@master
74
+ env:
75
+ SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
76
+ with:
77
+ args: --severity-threshold=high
@@ -0,0 +1,420 @@
1
+ #############################################################################
2
+ # https://github.com/github/gitignore/blob/main/Python.gitignore
3
+ #############################################################################
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[codz]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py.cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ # Pipfile.lock
100
+
101
+ # UV
102
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # uv.lock
106
+
107
+ # poetry
108
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
110
+ # commonly ignored for libraries.
111
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
+ # poetry.lock
113
+ # poetry.toml
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
118
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
119
+ # pdm.lock
120
+ # pdm.toml
121
+ .pdm-python
122
+ .pdm-build/
123
+
124
+ # pixi
125
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
126
+ # pixi.lock
127
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
128
+ # in the .venv directory. It is recommended not to include this directory in version control.
129
+ .pixi
130
+
131
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
+ __pypackages__/
133
+
134
+ # Celery stuff
135
+ celerybeat-schedule
136
+ celerybeat.pid
137
+
138
+ # Redis
139
+ *.rdb
140
+ *.aof
141
+ *.pid
142
+
143
+ # RabbitMQ
144
+ mnesia/
145
+ rabbitmq/
146
+ rabbitmq-data/
147
+
148
+ # ActiveMQ
149
+ activemq-data/
150
+
151
+ # SageMath parsed files
152
+ *.sage.py
153
+
154
+ # Environments
155
+ .env
156
+ .envrc
157
+ .venv
158
+ env/
159
+ venv/
160
+ ENV/
161
+ env.bak/
162
+ venv.bak/
163
+
164
+ # Spyder project settings
165
+ .spyderproject
166
+ .spyproject
167
+
168
+ # Rope project settings
169
+ .ropeproject
170
+
171
+ # mkdocs documentation
172
+ /site
173
+
174
+ # mypy
175
+ .mypy_cache/
176
+ .dmypy.json
177
+ dmypy.json
178
+
179
+ # Pyre type checker
180
+ .pyre/
181
+
182
+ # pytype static type analyzer
183
+ .pytype/
184
+
185
+ # Cython debug symbols
186
+ cython_debug/
187
+
188
+ # PyCharm
189
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
190
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
191
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
192
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
193
+ # .idea/
194
+
195
+ # Abstra
196
+ # Abstra is an AI-powered process automation framework.
197
+ # Ignore directories containing user credentials, local state, and settings.
198
+ # Learn more at https://abstra.io/docs
199
+ .abstra/
200
+
201
+ # Visual Studio Code
202
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
203
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
204
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
205
+ # you could uncomment the following to ignore the entire vscode folder
206
+ .vscode/
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
221
+
222
+ #############################################################################
223
+ # https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
224
+ #############################################################################
225
+
226
+ .vscode/*
227
+ !.vscode/settings.json
228
+ !.vscode/tasks.json
229
+ !.vscode/launch.json
230
+ !.vscode/extensions.json
231
+ !.vscode/*.code-snippets
232
+ !*.code-workspace
233
+
234
+ # Built Visual Studio Code Extensions
235
+ *.vsix
236
+
237
+ #############################################################################
238
+ # https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
239
+ #############################################################################
240
+
241
+ # General
242
+ .DS_Store
243
+ __MACOSX/
244
+ .AppleDouble
245
+ .LSOverride
246
+ Icon[
247
+ ]
248
+
249
+ # Thumbnails
250
+ ._*
251
+
252
+ # Files that might appear in the root of a volume
253
+ .DocumentRevisions-V100
254
+ .fseventsd
255
+ .Spotlight-V100
256
+ .TemporaryItems
257
+ .Trashes
258
+ .VolumeIcon.icns
259
+ .com.apple.timemachine.donotpresent
260
+
261
+ # Directories potentially created on remote AFP share
262
+ .AppleDB
263
+ .AppleDesktop
264
+ Network Trash Folder
265
+ Temporary Items
266
+ .apdisk
267
+
268
+ #############################################################################
269
+ # https://github.com/github/gitignore/blob/main/Global/Linux.gitignore
270
+ #############################################################################
271
+
272
+ *~
273
+
274
+ # temporary files which can be created if a process still has a handle open of a deleted file
275
+ .fuse_hidden*
276
+
277
+ # Metadata left by Dolphin file manager, which comes with KDE Plasma
278
+ .directory
279
+
280
+ # Linux trash folder which might appear on any partition or disk
281
+ .Trash-*
282
+
283
+ # .nfs files are created when an open file is removed but is still being accessed
284
+ .nfs*
285
+
286
+ # Log files created by default by the nohup command
287
+ nohup.out
288
+
289
+ #############################################################################
290
+ # https://github.com/github/gitignore/blob/main/Terraform.gitignore
291
+ #############################################################################
292
+
293
+ # Local .terraform directories
294
+ .terraform/
295
+
296
+ # .tfstate files
297
+ # *.tfstate
298
+ # *.tfstate.*
299
+
300
+ # Crash log files
301
+ crash.log
302
+ crash.*.log
303
+
304
+ # Exclude all .tfvars files, which are likely to contain sensitive data, such as
305
+ # password, private keys, and other secrets. These should not be part of version
306
+ # control as they are data points which are potentially sensitive and subject
307
+ # to change depending on the environment.
308
+ *.tfvars
309
+ *.tfvars.json
310
+
311
+ # Ignore override files as they are usually used to override resources locally and so
312
+ # are not checked in
313
+ override.tf
314
+ override.tf.json
315
+ *_override.tf
316
+ *_override.tf.json
317
+
318
+ # Ignore transient lock info files created by terraform apply
319
+ .terraform.tfstate.lock.info
320
+
321
+ # Include override files you do wish to add to version control using negated pattern
322
+ # !example_override.tf
323
+
324
+ # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
325
+ # example: *tfplan*
326
+
327
+ # Ignore CLI configuration files
328
+ .terraformrc
329
+ terraform.rc
330
+
331
+ # Optional: ignore graph output files generated by `terraform graph`
332
+ # *.dot
333
+
334
+ # Optional: ignore plan files saved before destroying Terraform configuration
335
+ # Uncomment the line below if you want to ignore planout files.
336
+ # planout
337
+
338
+ #############################################################################
339
+ # https://github.com/github/gitignore/blob/main/Global/MicrosoftOffice.gitignore
340
+ #############################################################################
341
+
342
+ *.tmp
343
+
344
+ # Word temporary
345
+ ~$*.doc*
346
+ ~$*.dot*
347
+
348
+ # Word Auto Backup File
349
+ Backup of *.doc*
350
+
351
+ # Excel temporary
352
+ ~$*.xls*
353
+
354
+ # Excel Backup File
355
+ *.xlk
356
+
357
+ # PowerPoint temporary
358
+ ~$*.ppt*
359
+
360
+ # Visio autosave temporary files
361
+ *.~vsd*
362
+
363
+ #############################################################################
364
+ # https://github.com/github/gitignore/blob/main/community/Obsidian/NotesAndCoreConfiguration.gitignore
365
+ #############################################################################
366
+
367
+ # Excludes Obsidian workspace cache and plugins. All notes and core obsidian
368
+ # configuration files are tracked by Git.
369
+
370
+ # The current application UI state (DOM layout, recently-opened files, etc.) is
371
+ # stored in these files (separate for desktop and mobile) so you can resume
372
+ # your session seamlessly after a restart. If you want to track UI state, use
373
+ # the Workspaces core plugin instead of relying on these files.
374
+ .obsidian/workspace.json
375
+ .obsidian/workspace-mobile.json
376
+
377
+ # Obsidian plugins are stored under .obsidian/plugins/$plugin_name. They
378
+ # contain metadata (manifest.json), application code (main.js), stylesheets
379
+ # (styles.css), and user-configuration data (data.json).
380
+ # We want to exclude all plugin-related files, so we can exclude everything
381
+ # under this directory.
382
+ .obsidian/plugins/**/*
383
+
384
+ #############################################################################
385
+ # Custom
386
+ #############################################################################
387
+
388
+ # Build artifacts and security outputs
389
+ artifacts/
390
+ sbom-cyclonedx.json
391
+
392
+ # Secret files (never commit these)
393
+ secrets.json
394
+ secrets.txt
395
+ secrets.yaml
396
+ secrets.yml
397
+ secrets.sh
398
+
399
+ # Release tarballs created locally
400
+ /*.tar.gz
401
+
402
+ # Coverage and test outputs (already partially covered above, explicit here)
403
+ .coverage
404
+ coverage.xml
405
+ htmlcov/
406
+
407
+ # pre-commit cache (local only, no value in version control)
408
+ .pre-commit-cache/
409
+
410
+ # Distribution metadata generated during local builds
411
+ *.dist-info/
412
+
413
+ # Editor-specific (already in vscode section above, but common in root)
414
+ *.swp
415
+ *.swo
416
+
417
+ # NetDoc example files
418
+ inventory.json
419
+ config.yaml
420
+ output
@@ -0,0 +1,21 @@
1
+ # MD013 - Line length
2
+ MD013:
3
+ line_length: 100
4
+ code_blocks: false
5
+ tables: false
6
+ strict: true
7
+
8
+ # MD024 - No duplicate headings (useful in changelogs where ## Added repeats)
9
+ MD024:
10
+ siblings_only: true # allows duplicate headings in different sections
11
+
12
+ # MD033 - No inline HTML (keep markdown portable)
13
+ MD033: false # set to true if you want to forbid <br>, <details> etc.
14
+
15
+ # MD046 - Code block style: enforce fenced blocks (```) over indented
16
+ MD046:
17
+ style: fenced
18
+
19
+ # MD048 - Code fence style: enforce backticks over tildes
20
+ MD048:
21
+ style: backtick
@@ -0,0 +1,93 @@
1
+ # Global excludes: apply to every hook unless overridden at hook level.
2
+ # Keep in sync with [tool.ruff] exclude in pyproject.toml.
3
+ exclude: >-
4
+ (?x)^(
5
+ __pycache__/.*|
6
+ \.git/.*|
7
+ \.venv/.*|
8
+ \.vscode/.*|
9
+ build/.*|
10
+ dist/.*|
11
+ env/.*|
12
+ venv/.*|
13
+ migrations/.*|
14
+ fonts/.*|
15
+ \.secrets\.baseline$|
16
+ .*\.qcow2$|
17
+ .*\.vma$
18
+ )$
19
+
20
+ repos:
21
+ # --------------------------------------------------------------------------
22
+ # General file hygiene
23
+ # Handles: trailing whitespace, EOF newline, BOM, CRLF, merge conflicts,
24
+ # large files, case conflicts, JSON/YAML/TOML syntax.
25
+ # --------------------------------------------------------------------------
26
+ - repo: https://github.com/pre-commit/pre-commit-hooks
27
+ rev: v6.0.0
28
+ hooks:
29
+ - id: check-added-large-files
30
+ - id: check-case-conflict
31
+ - id: check-json
32
+ - id: check-merge-conflict
33
+ - id: check-toml
34
+ - id: check-yaml
35
+ args: [--allow-multiple-documents]
36
+ - id: detect-private-key
37
+ - id: end-of-file-fixer
38
+ - id: trailing-whitespace
39
+
40
+ # --------------------------------------------------------------------------
41
+ # Python formatting + linting (single tool, replaces black + flake8 + pyupgrade)
42
+ # - ruff-format: drop-in replacement for black (respects pyproject.toml config)
43
+ # - ruff check: covers flake8 (E/F/W), isort (I), pyupgrade (UP), bugbear (B)
44
+ # and more — all configured in [tool.ruff.lint] in pyproject.toml
45
+ # --------------------------------------------------------------------------
46
+ - repo: https://github.com/astral-sh/ruff-pre-commit
47
+ rev: v0.11.13
48
+ hooks:
49
+ - id: ruff-check
50
+ name: ruff (check)
51
+ args: [--output-format=full]
52
+
53
+ - repo: https://github.com/pre-commit/pygrep-hooks
54
+ rev: v1.10.0
55
+ hooks:
56
+ - id: python-check-blanket-noqa
57
+ - id: python-no-eval
58
+ - id: text-unicode-replacement-char
59
+ - id: python-use-type-annotations
60
+
61
+ # --------------------------------------------------------------------------
62
+ # Security: static analysis for common vulnerabilities.
63
+ # Ruff has partial coverage (S ruleset) but bandit is more thorough.
64
+ # Config lives in .bandit.yaml (or pyproject.toml [tool.bandit]).
65
+ # --------------------------------------------------------------------------
66
+ - repo: https://github.com/PyCQA/bandit
67
+ rev: 1.9.4
68
+ hooks:
69
+ - id: bandit
70
+ args: ["-c", "pyproject.toml"] # prefer pyproject.toml over .bandit.yaml
71
+ exclude: ^tests/ # asserts and test patterns are expected
72
+
73
+ # --------------------------------------------------------------------------
74
+ # Markdown linting.
75
+ # Config in .markdownlint.yaml.
76
+ # --------------------------------------------------------------------------
77
+ - repo: https://github.com/igorshubovych/markdownlint-cli
78
+ rev: v0.45.0
79
+ hooks:
80
+ - id: markdownlint
81
+ args: ["--config=.markdownlint.yaml"]
82
+
83
+ # --------------------------------------------------------------------------
84
+ # Commit message: enforce Conventional Commits format.
85
+ # Required by release-please for automatic versioning.
86
+ # Allowed types: feat fix chore docs refactor test ci build perf
87
+ # --------------------------------------------------------------------------
88
+ - repo: https://github.com/compilerla/conventional-pre-commit
89
+ rev: v4.0.0
90
+ hooks:
91
+ - id: conventional-pre-commit
92
+ stages: [commit-msg]
93
+ args: [feat, fix, chore, docs, refactor, test, ci, build, perf]