Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 2.93 KB

README.md

File metadata and controls

86 lines (66 loc) · 2.93 KB

Configuration

The bot can be configured with a file located at .github/in-solidarity.yml in the target repo or at the same path in a repo named .github within the organization. The JSON schema is located at docs/schema.json.

rules:
  master:
    level: off
  slave:
    level: failure
    message: >
      Please consider an alternative to ``. 
      
      See http://example.com/ for more information
  foo:
    regex:
      - /foo/gi
      - /foobar/gi
    level: failure
ignore:
 - ".github/in-solidarity.yml"  # default
 - "**/*.yml"

The possible levels are ['off', 'notice', 'warning', 'failure']. These correspond to annotation_level in the GitHub API.

Note: The merging of defaults uses array replacement. This means any array provided by the configuration will be used and default elements ignored.

Note: The bot uses the configuration from the default branch. Therefore any changes to the configuration in a pull request will not be used until merged.

Note: Read more about configuration for organizations at Probot best practices.

Ignoring Defaults

The default rules can be ignored with ignoreDefaults: true such as in the following.

rules:
  foo:
    regex:
      - /foo/gi
      - /foobar/gi
    level: failure
ignoreDefaults: true

This will only check the single rule specified here.

Annotation Messages

The annotation messages generated from the checks can be customized in two ways:

  1. Set the message property on the rule.
  2. Set the defaultMessage property at the root of the config.

Priority is given to the message property on the rule. These strings use handlebars for templates with the following context.

  • name
  • match
  • alternatives
  • content
  • regex

The default message is:


Please consider an alternative to `{{match}}`. 
{{#if alternatives~}}

Possibilities include: {{#each alternatives}}{{#if @index}}, {{/if}}`{{this}}`{{/each}}
{{~/if}}

Rules

The following are the default rules.

rule level
master warning
slave warning
whitelist warning
blacklist warning
grandfathered off
sanity_check off
man_hours off

Note: Additional rules are welcome and can be added in src/rules.ts.

This document is generated from a template using src/rules.ts and docs/index.ts.