Skip to content

Commit

Permalink
Update pre-commit hooks (#2097)
Browse files Browse the repository at this point in the history
Signed-off-by: ammar <[email protected]>
Co-authored-by: Jan Klopper <[email protected]>
  • Loading branch information
ammar92 and underdarknl authored Dec 6, 2023
1 parent 6201fd5 commit 49d4a7b
Show file tree
Hide file tree
Showing 30 changed files with 266 additions and 401 deletions.
26 changes: 13 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
Expand All @@ -25,43 +25,43 @@ repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
rev: v0.15
hooks:
- id: validate-pyproject
files: pyproject.toml$

- repo: https://github.com/rstcheck/rstcheck
rev: v6.1.2
rev: v6.2.0
hooks:
- id: rstcheck
# https://github.com/rstcheck/rstcheck-core/issues/4
args: ["--ignore-messages", "Hyperlink target .* is not referenced", "--ignore-directives", "mermaid"]
additional_dependencies: ["rstcheck[sphinx]"]

- repo: https://github.com/MarketSquare/robotframework-tidy
rev: "4.1.0"
rev: "4.6.0"
hooks:
- id: robotidy

- repo: https://github.com/jendrikseipp/vulture
rev: v2.7
rev: v2.10
hooks:
- id: vulture
exclude: |
/tests/
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.263'
rev: 'v0.1.7'
hooks:
- id: ruff

- repo: https://github.com/psf/black
rev: "23.3.0"
rev: "23.11.0"
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.7.1
hooks:
- id: mypy
additional_dependencies: ['types-PyYAML', 'types-requests', 'types-cachetools', 'types-retry', 'pydantic', 'pynacl']
Expand All @@ -78,7 +78,7 @@ repos:
)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies: ['tomli']
Expand All @@ -104,7 +104,7 @@ repos:
)
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.32.1
rev: v1.34.0
hooks:
- id: djlint-reformat-django
files: |
Expand All @@ -123,7 +123,7 @@ repos:
exclude: '^rocky/rocky/templates/admin/.*\.html$'

- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v15.10.1
rev: v15.11.0
hooks:
- id: stylelint
args: [ --fix ]
Expand All @@ -133,13 +133,13 @@ repos:
files: "^(rocky\/assets\/css\/|docs\/source\/).*.(css|scss|sass)$"

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
rev: v0.9.0.6
hooks:
- id: shellcheck
args: ["-e", "SC1091"]

- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-1
rev: v3.7.0-4
hooks:
- id: shfmt
args: ["-w", "-s", "-i", "4", "-sr"]
3 changes: 1 addition & 2 deletions boefjes/boefjes/plugins/kat_manual/csv/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ def process_csv(csv_raw_data, reference_cache):
try:
ooi, extra_declarations = get_ooi_from_csv(object_type, row, reference_cache)

for declaration in extra_declarations:
yield declaration
yield from extra_declarations

yield {
"type": "declaration",
Expand Down
4 changes: 2 additions & 2 deletions boefjes/docs/normalisers-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ A single independent process that can be scaled horizontally (multiple processes
- Do we want to persist the normaliser output in Bytes, or send it directly to Octopoes?
- Do we want to align the runtime with one that can also work for Boefjes?
- Do we want to have support for multiple raw files as input?
- Do we want to re-use a running normaliser for multiple inputs, or do we set up and tear down the normaliser for each run?
- Do we want to reuse a running normaliser for multiple inputs, or do we set up and tear down the normaliser for each run?

## Conclusions
_As discussed with the team on 2023-07-20._

* The new normalisers output format should be refined and implemented outside the scope of the new normalisers runner.
* We need better development tooling (an SDK) for normalisers. A Python tool that takes a ZIP file from Bytes, runs the normaliser, and shows normaliser output on screen was proposed and would greatly help the development cycle.
* A new boefjes runner should be prioritised higher than the normalisers runner because we have more issues with the current boefjes runner: boefjes have more diverse dependencies and require external tools. We can likely re-use a part of the boefjes runner for normalisers.
* A new boefjes runner should be prioritised higher than the normalisers runner because we have more issues with the current boefjes runner: boefjes have more diverse dependencies and require external tools. We can likely reuse a part of the boefjes runner for normalisers.
* We should not forget about bits; these also need a better design.
* Overhead for runner normalisers should be limited, for example by allowing batched requests or multiple runs without having to restart the normaliser.
Loading

0 comments on commit 49d4a7b

Please sign in to comment.