Skip to content

rusinikita/changes

Repository files navigation

linter coverage mutation

Changes helps automate code review and enforce team agreements.

It validates git diff with simple configuration and the CEL scripting language.

Visit project GH pages site for detail documentation.

commit:
  # Commit message format validation. Example - `TEAM-123: fix something`
  subject: '(issue): (type)? (title)'
  values:
    issue:
      regexp: TEAM-\d+
check-functions:
  - message: use separate PRs for fixes and features
    # Function checks parsed commit types
    func: 'commits.exists(c, c.type == "fix") && commits.exists(c, c.type == "feat")'
  - message: page contains draft flag and will not be shown
    # Function checks changed files and its content
    func: changes.filter(c,
      c.path.endsWith(".md") && c.chunks.exists(ch, ch.content.contains("draft:"))
      )

Output

Changes
-------
docs/content/docs/ADR/24.02-output-message.md
- draft page will not be shown

Commits
-------
12341324: test
- type: value must be one of [fix ref feat]

Autonomous

You can use it locally, as a CI step, and in combination with messages posting tools.

An github PR comment

See working GitHub actions configuration

Alternatives

Danger and conventional-changelog - both great tools for JS and Ruby community.

Changes brings advantages for users of other languages:

  1. yaml/toml configuration familiarity and simplicity
  2. One tool to rule. Validation and changelog generation use the same message format
  3. Well-designed configuration and scripting DSL
  4. Go code maintainability and execution speed

Project state

Note

Production ready

Project has solid API and active maintenance.

Please provide your feedback and ideas in discussions.

Tip

Support

Use ! in issue title to get help within 2 hours.

Visit project GH pages site for detail documentation.