Skip to content

ci: add commit message linting to ci workflow#348

Open
ayushiahjolia wants to merge 1 commit intomainfrom
ci_linter
Open

ci: add commit message linting to ci workflow#348
ayushiahjolia wants to merge 1 commit intomainfrom
ci_linter

Conversation

@ayushiahjolia
Copy link
Copy Markdown
Contributor

@ayushiahjolia ayushiahjolia commented Apr 17, 2026

Issue #, if available: #345

Description of changes:

  • Added --range flag to lintcommit.py for CI to validate commits in a git revision range (e.g. origin/main..<head sha>)
  • Added lint-commits CI job that runs on pull_request events
  • Refactored commit parsing to use null char separator (-z) and --no-merges instead of magic string delimiter and merge skip logic
  • Extracted lint_range() returning LintResult/CommitResult dataclasses so tests assert on returned data instead of stdout/stderr

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ayushiahjolia ayushiahjolia self-assigned this Apr 17, 2026
@ayushiahjolia
Copy link
Copy Markdown
Contributor Author

lint-pr-title job is skipped for this PR, because it was introduced in this PR. It will run on subsequent PRs.

@ayushiahjolia ayushiahjolia force-pushed the ci_linter branch 2 times, most recently from e660273 to 4c897b5 Compare April 24, 2026 18:48
@ayushiahjolia ayushiahjolia changed the title ci: add pr title linting to ci workflow ci: add commit message linting to ci workflow Apr 24, 2026
@ayushiahjolia ayushiahjolia force-pushed the ci_linter branch 3 times, most recently from c55fe7d to 7f7fbfa Compare April 24, 2026 19:00
Comment thread ops/lintcommit.py Outdated
Comment thread ops/tests/test_lintcommit.py Outdated
Comment thread ops/lintcommit.py Outdated
Comment thread ops/lintcommit.py Outdated
Comment thread ops/lintcommit.py
#
# To run tests:
#
# python -m pytest ops/tests/test_lintcommit.py
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.

The package name ops is misleading IMO, makes me think this is a SDK operation tool at runtime. We could put these github workflow scripts under .github

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.

And BTW, ci-checks.sh script is broken due to lintcommit.py

# commit message validation
python ops/lintcommit.py

This script should run in hatch's virtualenv.

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.

3 participants