Skip to content

Repository files navigation

serokell_danger

GitHub/GitLab-agnostic Danger checks for CI review: commit style, license headers, MR/PR conventions.

CI License: MPL-2.0

Table of contents

Background

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.

Install

Published as a git source:

# Gemfile
gem "serokell_danger", git: "https://github.com/serokell/danger"

Usage

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_whitespace

Each 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.

Contributing

See CONTRIBUTING.md.

License

MPL-2.0 © Serokell

About 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!

About

Serokell's github/gitlab-agnostic Danger checks (commit style, license headers, MR/PR conventions) for CI review

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages