Introduction

You can define your rules by either logging in to the GitMagic app and using the rules editor or by committing a contributing.json file to the master branch of your repo.

If you choose to commit a contributing.json file then any rules made in the app will be ignored.

If you're not interested in enforcing a certain rule, just turn it off (or omit it from your json file) (i.e. there are no default values).

Click on one of the rules to learn more about it.

Want a rule that is not listed here? Please let us know.

Back to the GitMagic site.

                "commit":
                    "cannot_be_fixup": true
            
                    // Subject is the first paragraph of the commit message.
                    "subject_cannot_be_empty": true
                    "subject_must_be_longer_than": 5
                    "subject_must_be_shorter_than": 100
                    "subject_lines_must_be_shorter_than": 50
                    "subject_must_be_single_line": true
                    "subject_must_be_in_case": "lower"
                    "subject_must_be_in_tense": "imperative"
                    "subject_must_start_with_case": "lower"
                    "subject_must_end_with_dot": true
                    "subject_must_not_end_with_dot": true
                    "subject_must_include_prefix": ["feat", "fix", "docs", "refactor"]
                    "subject_must_close_github_issue": true
                    "subject_must_include_github_issue": true
                    "subject_must_include_jira_issue": true
            
                    // Body is the rest of the commit message after the first paragraph
                    // separated by a blank line.
                    "body_cannot_be_empty": true
                    "body_lines_must_be_shorter_than": 70
                    "body_must_close_github_issue": true
                    "body_must_include_github_issue": true
                    "body_must_include_jira_issue": true
            
                "pull_request":
                    "additions_must_be_greater_than": 50
                    "additions_must_be_less_than": 300
                    "changes_must_be_greater_than": 50
                    "changes_must_be_less_than": 500
                    "changed_files_must_be_greater_than": 1
                    "changed_files_must_be_less_than": 10
            
                    "subject_cannot_be_empty": true
                    "subject_must_be_longer_than": 5
                    "subject_must_be_shorter_than": 100
                    "subject_must_be_in_tense": "imperative"
                    "subject_must_start_with_case": "upper"
                    "subject_must_end_with_dot": true
                    "subject_must_not_end_with_dot": true
                    "subject_must_include_prefix": ["feat", "fix", "docs", "refactor"]
                    "subject_must_include_github_issue": true
                    "subject_must_include_jira_issue": true
            
                    "body_cannot_be_empty": true
                    "body_must_include_verification_steps": true
                    "body_must_include_screenshot": ["html", "scss"],
                    "body_must_close_github_issue": true
                    "body_must_include_github_issue": true
                    "body_must_include_jira_issue": true
            
                "issue":
                    "subject_cannot_be_empty": true
                    "subject_must_be_longer_than": 5
                    "subject_must_be_shorter_than": 100
                    "subject_must_be_in_tense": "imperative"
                    "subject_must_start_with_case": "upper"
                    "subject_must_end_with_dot": true
                    "subject_must_not_end_with_dot": true
                    "subject_must_include_prefix": ["feat", "fix", "docs", "refactor"]
            
                    "body_cannot_be_empty": true
                    "body_must_include_reproduction_steps": ["bug"]
            
                    "label_must_be_set": true
            
                "branch":
                    // The GitMagic service will enforce branch names in pull requests only.
                    "name_must_be_longer_than": 5
                    "name_must_be_shorter_than": 100
                    "name_must_include_prefix": ["feat", "fix", "docs", "refactor"]
                    "name_must_include_github_issue": true
                    "name_must_include_jira_issue": true