Skip to content

chore: migrate formatting to ruff, update CI/CD and bump to v0.20.3 - #76

Merged
frack113 merged 18 commits into
SigmaHQ:mainfrom
frack113:maintenance
Jul 7, 2026
Merged

chore: migrate formatting to ruff, update CI/CD and bump to v0.20.3#76
frack113 merged 18 commits into
SigmaHQ:mainfrom
frack113:maintenance

Conversation

@frack113

@frack113 frack113 commented Jun 19, 2026

Copy link
Copy Markdown
Member

This PR covers the changes between v0.20.2 and v0.20.3.

Dependencies & Tooling

  • Replace Black with Ruff for formatting and linting in pre-commit hooks, CI workflows, and pyproject.toml
  • Add check-jsonschema as a dev dependency for JSON schema validation
  • Update pre-commit Black hook version references before removal

CI/CD & GitHub Actions

  • Bump GitHub Actions to checkout@v5, setup-python@v6, and gh-action-pypi-publish@release/v1
  • Add Poetry cache in CI workflows
  • Install ruff via pip in CI test workflow for linting
  • Remove update_data.yml workflow (replaced by manual/data sync process)
  • Add Poetry setup + poetry install in schema validation workflow

Configuration

  • Ruff configuration added to pyproject.toml (line length 100, target py310, project-specific ignores for tests/tools)
  • Mypy configuration added with relaxed permissive settings and pytest ignore
  • Version bump to 0.20.3

Code style fixes

  • Reorder imports across all SigmaHQ validator modules to follow consistent ordering (standard library → third-party → local)
  • Format long lines in sigmahq_data.py (logsource field lists split across multiple lines)
  • Add type ignore comment in correlation.py for rule.rules length check
  • Format pformat() calls in tools/update_ref.py

Test updates

Fix validation checks across all test files to match updated validator logic:

  • condition validators (missing_asterisk, ofselection, ofthem)
  • correlation validators (groupby_existence, rules_minimum)
  • date validators (modified_date_order, modified_without_date, redundant_modified)
  • description validators (existence, length, link_in_description)
  • field validators (user, fieldname_cast, invalid_all_modifier, invalid_fieldname, invalid_hash_kv, redundant_field, space_fieldname, fields_existence)
  • fields validators (unknown_field)
  • filename validators (correlation_prefix, convention, prefix)
  • other validators (logsource_unknown, sysmon_missing_eventid, github_link, mitre_link, status_to_high, status)
  • tag validators (detection, techniques_without_tactics, tlp, unique_detection, unique_tlp)
  • title validators (title_case, title_end, title_length, title_start)
  • Update test_config.py to match new config structure
  • Add missing test assertions for author_existence and category_eventid / category_windows_provider_name validators

@frack113 frack113 changed the title 🔧 chore: migrate uv to poetry and add check-jsonschema 🔧 bump: migrate from uv to poetry and add check-jsonschema Jun 19, 2026
@frack113 frack113 changed the title 🔧 bump: migrate from uv to poetry and add check-jsonschema chore: migrate formatting to ruff, update CI/CD and bump to v0.20.3 Jun 19, 2026
@frack113
frack113 requested a review from phantinuss June 26, 2026 14:45
@frack113

Copy link
Copy Markdown
Member Author
$  pip list | grep -i sigma
pySigma                                1.4.0
pySigma-validators-sigmahq             0.20.3
sigma-cli                              3.0.2
$
$ sigma check rules* -c tests/sigma_cli_conf.yml 
Parsing Sigma rules  [####################################]  100%          
Parsing Sigma rules  [####################################]  100%
Parsing Sigma rules  [####################################]  100%
Parsing Sigma rules  [####################################]  100%
Parsing Sigma rules  [####################################]  100%
Parsing Sigma rules  [####################################]  100%
Checking Sigma rules  [####################################]  100%          

=== Summary ===
Found 0 errors, 0 condition errors and 0 issues.
No rule errors found.
No condition errors found.
No validation issues found.

'''

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
@frack113
frack113 merged commit 6a689f9 into SigmaHQ:main Jul 7, 2026
20 checks passed
@frack113
frack113 deleted the maintenance branch July 7, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants