diff options
Diffstat (limited to '0.19.x/rules/user_defined_rules/rule_format_spec/index.html')
-rw-r--r-- | 0.19.x/rules/user_defined_rules/rule_format_spec/index.html | 1264 |
1 files changed, 0 insertions, 1264 deletions
diff --git a/0.19.x/rules/user_defined_rules/rule_format_spec/index.html b/0.19.x/rules/user_defined_rules/rule_format_spec/index.html deleted file mode 100644 index cad0d1c..0000000 --- a/0.19.x/rules/user_defined_rules/rule_format_spec/index.html +++ /dev/null @@ -1,1264 +0,0 @@ - -<!doctype html> -<html lang="en" class="no-js"> - <head> - - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width,initial-scale=1"> - - <meta name="description" content="Linting for your git commit messages"> - - - - <link rel="canonical" href="https://jorisroovers.github.io/gitlint/0.19.x/rules/user_defined_rules/rule_format_spec/"> - - - <link rel="prev" href="../options/"> - - - <link rel="next" href="../../../contributing/"> - - <link rel="icon" href="../../../assets/images/favicon.png"> - <meta name="generator" content="mkdocs-1.4.3, mkdocs-material-9.1.9"> - - - - <title>Rule Specification - Gitlint</title> - - - - <link rel="stylesheet" href="../../../assets/stylesheets/main.85bb2934.min.css"> - - - <link rel="stylesheet" href="../../../assets/stylesheets/palette.a6bdf11c.min.css"> - - - - - - - - - - <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> - <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"> - <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style> - - - - <link rel="stylesheet" href="../../../stylesheets/termynal.css"> - - <link rel="stylesheet" href="../../../stylesheets/extra.css"> - - <script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script> - - - - - - - </head> - - - - - - - - - - <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo"> - - - - <script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script> - - <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off"> - <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> - <label class="md-overlay" for="__drawer"></label> - <div data-md-component="skip"> - - - <a href="#rule-class-requirements" class="md-skip"> - Skip to content - </a> - - </div> - <div data-md-component="announce"> - - </div> - - <div data-md-color-scheme="default" data-md-component="outdated" hidden> - - </div> - - - - - - -<header class="md-header md-header--shadow md-header--lifted" data-md-component="header"> - <nav class="md-header__inner md-grid" aria-label="Header"> - <a href="../../.." title="Gitlint" class="md-header__button md-logo" aria-label="Gitlint" data-md-component="logo"> - - - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg> - - </a> - <label class="md-header__button md-icon" for="__drawer"> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg> - </label> - <div class="md-header__title" data-md-component="header-title"> - <div class="md-header__ellipsis"> - <div class="md-header__topic"> - <span class="md-ellipsis"> - Gitlint - </span> - </div> - <div class="md-header__topic" data-md-component="header-topic"> - <span class="md-ellipsis"> - - Rule Specification - - </span> - </div> - </div> - </div> - - - <form class="md-header__option" data-md-component="palette"> - - - - - <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1"> - - <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg> - </label> - - - - - - <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2"> - - <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12c0-2.42-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg> - </label> - - - </form> - - - - - - <div class="md-header__source"> - <a href="https://github.com/jorisroovers/gitlint" title="Go to repository" class="md-source" data-md-component="source"> - <div class="md-source__icon md-icon"> - - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg> - </div> - <div class="md-source__repository"> - jorisroovers/gitlint - </div> -</a> - </div> - - </nav> - - - -<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs"> - <div class="md-grid"> - <ul class="md-tabs__list"> - - - - - - - - - - <li class="md-tabs__item"> - <a href="../../.." class="md-tabs__link"> - Home - </a> - </li> - - - - - - - - - - - - <li class="md-tabs__item"> - <a href="../../../configuration/" class="md-tabs__link"> - Configuration - </a> - </li> - - - - - - - - - - - - - - <li class="md-tabs__item"> - <a href="../../" class="md-tabs__link md-tabs__link--active"> - Rules - </a> - </li> - - - - - - - - - - - - <li class="md-tabs__item"> - <a href="../../../contributing/" class="md-tabs__link"> - Contributing - </a> - </li> - - - - - - - - - <li class="md-tabs__item"> - <a href="https://github.com/jorisroovers/gitlint/blob/main/CHANGELOG.md" class="md-tabs__link"> - Changelog - </a> - </li> - - - </ul> - </div> -</nav> - - -</header> - - <div class="md-container" data-md-component="container"> - - - - - <main class="md-main" data-md-component="main"> - <div class="md-main__inner md-grid"> - - - - <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" > - <div class="md-sidebar__scrollwrap"> - <div class="md-sidebar__inner"> - - - - - -<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0"> - <label class="md-nav__title" for="__drawer"> - <a href="../../.." title="Gitlint" class="md-nav__button md-logo" aria-label="Gitlint" data-md-component="logo"> - - - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg> - - </a> - Gitlint - </label> - - <div class="md-nav__source"> - <a href="https://github.com/jorisroovers/gitlint" title="Go to repository" class="md-source" data-md-component="source"> - <div class="md-source__icon md-icon"> - - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg> - </div> - <div class="md-source__repository"> - jorisroovers/gitlint - </div> -</a> - </div> - - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - - - - <li class="md-nav__item md-nav__item--nested"> - - - - - <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_1" > - - - - <label class="md-nav__link" for="__nav_1" id="__nav_1_label" tabindex="0"> - Home - <span class="md-nav__icon md-icon"></span> - </label> - - <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_1_label" aria-expanded="false"> - <label class="md-nav__title" for="__nav_1"> - <span class="md-nav__icon md-icon"></span> - Home - </label> - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - <li class="md-nav__item"> - <a href="../../.." class="md-nav__link"> - Introduction - </a> - </li> - - - - - - - - - - - - - <li class="md-nav__item md-nav__item--section md-nav__item--nested"> - - - - - <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_1_2" > - - - - <label class="md-nav__link" for="__nav_1_2" id="__nav_1_2_label" tabindex="0"> - Getting Started - <span class="md-nav__icon md-icon"></span> - </label> - - <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_1_2_label" aria-expanded="false"> - <label class="md-nav__title" for="__nav_1_2"> - <span class="md-nav__icon md-icon"></span> - Getting Started - </label> - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - <li class="md-nav__item"> - <a href="../../../getting_started/" class="md-nav__link"> - Quickstart - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../installation/" class="md-nav__link"> - Installation - </a> - </li> - - - - - </ul> - </nav> - </li> - - - - - - - - - - - - - <li class="md-nav__item md-nav__item--section md-nav__item--nested"> - - - - - <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_1_3" > - - - - <label class="md-nav__link" for="__nav_1_3" id="__nav_1_3_label" tabindex="0"> - Using Gitlint - <span class="md-nav__icon md-icon"></span> - </label> - - <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_1_3_label" aria-expanded="false"> - <label class="md-nav__title" for="__nav_1_3"> - <span class="md-nav__icon md-icon"></span> - Using Gitlint - </label> - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - <li class="md-nav__item"> - <a href="../../../commit_hooks/" class="md-nav__link"> - Commit hook Setup - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../ci/" class="md-nav__link"> - CI Setup - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../linting_specific_commits/" class="md-nav__link"> - Linting specific commits - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../ignoring_commits/" class="md-nav__link"> - Ignoring commits - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../exit_codes/" class="md-nav__link"> - Exit Codes - </a> - </li> - - - - - </ul> - </nav> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../alternatives/" class="md-nav__link"> - Alternatives - </a> - </li> - - - - - </ul> - </nav> - </li> - - - - - - - - - - - - <li class="md-nav__item md-nav__item--nested"> - - - - - <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" > - - - - <label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0"> - Configuration - <span class="md-nav__icon md-icon"></span> - </label> - - <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false"> - <label class="md-nav__title" for="__nav_2"> - <span class="md-nav__icon md-icon"></span> - Configuration - </label> - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - <li class="md-nav__item"> - <a href="../../../configuration/" class="md-nav__link"> - Overview - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../configuration/gitlint_file/" class="md-nav__link"> - .gitlint file - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../configuration/cli/" class="md-nav__link"> - Commandline config - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../configuration/commit_config/" class="md-nav__link"> - Commit specific config - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../configuration/general_options/" class="md-nav__link"> - General Options - </a> - </li> - - - - - </ul> - </nav> - </li> - - - - - - - - - - - - - - <li class="md-nav__item md-nav__item--active md-nav__item--nested"> - - - - - <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked> - - - - <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0"> - Rules - <span class="md-nav__icon md-icon"></span> - </label> - - <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true"> - <label class="md-nav__title" for="__nav_3"> - <span class="md-nav__icon md-icon"></span> - Rules - </label> - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - <li class="md-nav__item"> - <a href="../../" class="md-nav__link"> - Overview - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../builtin_rules/" class="md-nav__link"> - Built-in Rules - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../contrib_rules/" class="md-nav__link"> - Contrib Rules - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../named_rules/" class="md-nav__link"> - Named Rules - </a> - </li> - - - - - - - - - - - - - - - <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested"> - - - - - <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_5" checked> - - - - <label class="md-nav__link" for="__nav_3_5" id="__nav_3_5_label" tabindex="0"> - User Defined Rules - <span class="md-nav__icon md-icon"></span> - </label> - - <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_5_label" aria-expanded="true"> - <label class="md-nav__title" for="__nav_3_5"> - <span class="md-nav__icon md-icon"></span> - User Defined Rules - </label> - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - <li class="md-nav__item"> - <a href="../" class="md-nav__link"> - Getting Started - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../line_and_commit_rules/" class="md-nav__link"> - Line and Commit Rules - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../configuration_rules/" class="md-nav__link"> - Configuration Rules - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../violations/" class="md-nav__link"> - Rule Violations - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../options/" class="md-nav__link"> - Rule Options - </a> - </li> - - - - - - - - - - - - <li class="md-nav__item md-nav__item--active"> - - <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc"> - - - - <label class="md-nav__link md-nav__link--active" for="__toc"> - Rule Specification - <span class="md-nav__icon md-icon"></span> - </label> - - <a href="./" class="md-nav__link md-nav__link--active"> - Rule Specification - </a> - - - -<nav class="md-nav md-nav--secondary" aria-label="Table of contents"> - - - - - <label class="md-nav__title" for="__toc"> - <span class="md-nav__icon md-icon"></span> - Table of contents - </label> - <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> - - <li class="md-nav__item"> - <a href="#rule-class-requirements" class="md-nav__link"> - Rule class requirements - </a> - -</li> - - <li class="md-nav__item"> - <a href="#extra-path-requirements" class="md-nav__link"> - extra-path requirements - </a> - -</li> - - </ul> - -</nav> - - </li> - - - - - </ul> - </nav> - </li> - - - - - </ul> - </nav> - </li> - - - - - - - - - - - - <li class="md-nav__item md-nav__item--nested"> - - - - - <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" > - - - - <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0"> - Contributing - <span class="md-nav__icon md-icon"></span> - </label> - - <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false"> - <label class="md-nav__title" for="__nav_4"> - <span class="md-nav__icon md-icon"></span> - Contributing - </label> - <ul class="md-nav__list" data-md-scrollfix> - - - - - - - <li class="md-nav__item"> - <a href="../../../contributing/" class="md-nav__link"> - Overview - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../contributing/environment_setup/" class="md-nav__link"> - Environment Setup - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../contributing/tests_formatting_docs/" class="md-nav__link"> - Tests, Formatting, Docs - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../contributing/packaging/" class="md-nav__link"> - Packaging - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../contributing/releases/" class="md-nav__link"> - Releases - </a> - </li> - - - - - - - - - - <li class="md-nav__item"> - <a href="../../../contributing/contrib_rules/" class="md-nav__link"> - Contributing Contrib Rules - </a> - </li> - - - - - </ul> - </nav> - </li> - - - - - - - - - - - <li class="md-nav__item"> - <a href="https://github.com/jorisroovers/gitlint/blob/main/CHANGELOG.md" class="md-nav__link"> - Changelog - </a> - </li> - - - - </ul> -</nav> - </div> - </div> - </div> - - - - <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" > - <div class="md-sidebar__scrollwrap"> - <div class="md-sidebar__inner"> - - -<nav class="md-nav md-nav--secondary" aria-label="Table of contents"> - - - - - <label class="md-nav__title" for="__toc"> - <span class="md-nav__icon md-icon"></span> - Table of contents - </label> - <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> - - <li class="md-nav__item"> - <a href="#rule-class-requirements" class="md-nav__link"> - Rule class requirements - </a> - -</li> - - <li class="md-nav__item"> - <a href="#extra-path-requirements" class="md-nav__link"> - extra-path requirements - </a> - -</li> - - </ul> - -</nav> - </div> - </div> - </div> - - - - <div class="md-content" data-md-component="content"> - <article class="md-content__inner md-typeset"> - - - - - <a href="https://github.com/jorisroovers/gitlint/edit/main/docs/rules/user_defined_rules/rule_format_spec.md" title="Edit this page" class="md-content__button md-icon"> - - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"/></svg> - </a> - - - - - - <a href="https://github.com/jorisroovers/gitlint/raw/main/docs/rules/user_defined_rules/rule_format_spec.md" title="View source of this page" class="md-content__button md-icon"> - - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 18c.56 0 1 .44 1 1s-.44 1-1 1-1-.44-1-1 .44-1 1-1m0-3c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5M9.27 20H6V4h7v5h5v4.07c.7.08 1.36.25 2 .49V8l-6-6H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4.5a8.15 8.15 0 0 1-1.23-2Z"/></svg> - </a> - - - - <h1>Rule Specification</h1> - -<p>As long as you stick with simple rules that are similar to the sample user-defined rules (see the -<a href="https://github.com/jorisroovers/gitlint/blob/main/examples/my_commit_rules.py">examples</a> directory), gitlint -should be able to discover and execute them. While clearly you can run any python code you want in your rules, -you might run into some issues if you don't follow the conventions that gitlint requires.</p> -<p>While the <a href="https://github.com/jorisroovers/gitlint/blob/main/gitlint-core/gitlint/rule_finder.py">rule finding source-code</a> is the -ultimate source of truth, here are some of the requirements that gitlint enforces.</p> -<h3 id="rule-class-requirements">Rule class requirements<a class="headerlink" href="#rule-class-requirements" title="Permanent link">¶</a></h3> -<ul> -<li>Rules <strong>must</strong> extend from <code>LineRule</code>, <code>CommitRule</code> or <code>ConfigurationRule</code></li> -<li>Rule classes <strong>must</strong> have <code>id</code> and <code>name</code> string attributes. The <code>options_spec</code> is optional, - but if set, it <strong>must</strong> be a list of gitlint Options.</li> -<li><code>CommitRule</code> and <code>LineRule</code> classes <strong>must</strong> have a <code>validate</code> method.</li> -<li>In case of a <code>CommitRule</code>, <code>validate</code> <strong>must</strong> take a single <code>commit</code> parameter.</li> -<li>In case of <code>LineRule</code>, <code>validate</code> <strong>must</strong> take <code>line</code> and <code>commit</code> as first and second parameters.</li> -<li><code>ConfigurationRule</code> classes <strong>must</strong> have an <code>apply</code> method that take <code>config</code> and <code>commit< |