Skip to content

Pre-commit and PR linters and check scripts - #30

Open
joniohtonen wants to merge 2 commits into
mainfrom
feature/pre-commit-and-pr-workflows
Open

Pre-commit and PR linters and check scripts#30
joniohtonen wants to merge 2 commits into
mainfrom
feature/pre-commit-and-pr-workflows

Conversation

@joniohtonen

@joniohtonen joniohtonen commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Added pre-commit checks/linting (ruff, yamllint, shellcheck, custom check_spdx_headers script) during commit for changed files, added workflow for running similar checks for changed fiels during PR creation.

Background

We are missing a programmatical approach for ensuring quality in our codebase. Using pre-commit to enforce certain aspects of the QC is an easy first step, as well as using a dedicated workflow for running the same checks that the PRs stay uniform in this regard too.

Goals

Enable automated, rudimentary QC when it comes to raw code and configurations files in order to avoid errors due to testing oversights etc.

Tasks

  • Extend existing pre-commit to include other checks and linters than custom check_spdx_headers script.
  • Add a workflow that runs these same checks when a PR is opened.

Tests

  • Test linters locally
  • Tested workflow by opening this PR.

Other

Majority of the existing Python and YAML files had some aspects that ruff and yamllint were opinionated about, mostly whitespace, so the pre-commit and the PR workflow only check for changed files. This is to ensure that there isn't a sudden megacommit consisting whitespace fixes etc.

…heck_spdx_headers script) during commit for changed files, added workflow for running similar checks for changed fiels during PR creation.
@joniohtonen joniohtonen self-assigned this Aug 25, 2026
@joniohtonen joniohtonen added the enhancement New feature or request label Aug 25, 2026
@joniohtonen
joniohtonen requested review from a team as code owners August 25, 2026 11:50
@joniohtonen

Copy link
Copy Markdown
Contributor Author

Fixed linter errors in the workflow itself.

@lauri9 lauri9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good starting point.

Could you generate some documentation, e.g., to CONTRIBUTING.md or README.md about these checks and how to run them locally? This would help developers and agents keep up the standards set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants