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.
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.
The annotation messages generated from the checks can be customized in two ways:
- Set the
message
property on the rule. - 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}}
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.