From 14306fa1bd9c84a85652563e8a713284792a4278 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 2 Aug 2024 18:43:41 +0100 Subject: [PATCH] test: fix pre-commit reported issues (#218) --- .gitleaks.toml | 2 +- .pre-commit-config.yaml | 7 +++++++ extensions/eda/rulebooks/demo_rulebook.yml | 2 +- tox.ini | 7 ++++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitleaks.toml b/.gitleaks.toml index 7ca70cb7..4922d000 100644 --- a/.gitleaks.toml +++ b/.gitleaks.toml @@ -2,4 +2,4 @@ description = "Global Allowlist" # Ignore based on any subset of the file path -paths = ['''tests\/unit\/event_source\/certs'''] \ No newline at end of file +paths = ['''tests\/unit\/event_source\/certs'''] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb0ef1ec..63bca1e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,8 @@ +ci: + skip: + # These will not run on pre-commit.ci due to required network access: + - ansible-test-sanity + - tox exclude: "^.*\\.md$" repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -13,6 +18,7 @@ repos: name: Run ansible-test sanity entry: ansible-test sanity require_serial: true + stages: [manual] language: python additional_dependencies: - ansible @@ -23,4 +29,5 @@ repos: entry: tox language: python require_serial: true + stages: [manual] pass_filenames: false diff --git a/extensions/eda/rulebooks/demo_rulebook.yml b/extensions/eda/rulebooks/demo_rulebook.yml index dc76eb30..450a0634 100644 --- a/extensions/eda/rulebooks/demo_rulebook.yml +++ b/extensions/eda/rulebooks/demo_rulebook.yml @@ -1,6 +1,6 @@ --- # This rulebook is for demo purposes only -# Typically the events come from an external source +# Typically the events come from an external source # and you might have to configure the external source # and have it generate events on demand. # In this simple rulebook the events to be generated diff --git a/tox.ini b/tox.ini index 25636ebf..4bd47735 100644 --- a/tox.ini +++ b/tox.ini @@ -4,14 +4,19 @@ [tox] # envlist = ruff, darglint, pylint-event-source, pylint-event-filter -envlist = ruff, pylint-event-source, pylint-event-filter, isort, black +envlist = lint, ruff, pylint-event-source, pylint-event-filter, isort, black requires = + lint ruff darglint pylint [testenv] basepython = python3.9, python3.10 +[testenv:lint] +deps = pre-commit +desc = Run linters +commands = pre-commit run -a [testenv:ruff] deps = -r{toxinidir}/lint_requirements.txt