GitHub/GitLab-agnostic Danger checks for CI review: commit style, license headers, MR/PR conventions.
Danger runs a Dangerfile against every pull
request and lets it post review comments back to GitHub or GitLab. This gem
adds a set of checks written against Danger's own primitives:
check_commits_style— commit subject/description formatting.check_premerge_commits— flags fixup/squash-worthy commits before merge.check_merge_request— MR/PR title and description conventions.check_merge_commits— merge-commit hygiene on the target branch.check_license_headers— flags stale SPDX copyright years on changed files.check_trailing_whitespace— flags trailing whitespace on changed lines.
Each check is configurable per-repository, and GitHost (in helpers.rb)
gives every check the same interface over GitHub's and GitLab's otherwise
different plugin APIs, so a single Dangerfile works unmodified on either
host.
Published as a git source:
# Gemfile
gem "serokell_danger", git: "https://github.com/serokell/danger"Require it and call the checks you want from your Dangerfile:
# Dangerfile
require "serokell_danger"
check_commits_style
check_premerge_commits
check_merge_request
check_merge_commits
check_license_headers
check_trailing_whitespaceEach check accepts an optional config, built by overriding its defaults:
check_commits_style(commits_style_default_config.with(severity: :error))See each check's *_default_config method under lib/serokell_danger/checks/
for the options it accepts.
See CONTRIBUTING.md.
MPL-2.0 © Serokell
serokell_danger is maintained and funded with ❤️ by Serokell. The names and logo for Serokell are trademark of Serokell OÜ.
We love open source software! See our other projects or hire us to design, develop and grow your idea!