lint: Setup gitlint.
Setup gitlint for developers to write well formatted commit messages. Note: .gitlint, gitlint-rules.py and lint-commits are taken directly from zulip/zulip with minor changes.
This commit is contained in:
parent
f8cd424495
commit
cce18ed11b
5 changed files with 193 additions and 0 deletions
|
@ -15,6 +15,7 @@ EXCLUDED_FILES = [
|
|||
def run() -> None:
|
||||
parser = argparse.ArgumentParser()
|
||||
add_default_linter_arguments(parser)
|
||||
parser.add_argument('--no-gitlint', action='store_true', help='Disable gitlint')
|
||||
args = parser.parse_args()
|
||||
|
||||
linter_config = LinterConfig(args)
|
||||
|
@ -27,6 +28,10 @@ def run() -> None:
|
|||
linter_config.external_linter('flake8', ['flake8'], ['py'],
|
||||
description="Standard Python linter (config: .flake8)")
|
||||
|
||||
if not args.no_gitlint:
|
||||
linter_config.external_linter('gitlint', ['tools/lint-commits'],
|
||||
description="Git Lint for commit messages")
|
||||
|
||||
@linter_config.lint
|
||||
def custom_py() -> int:
|
||||
"""Runs custom checks for python files (config: tools/linter_lib/custom_check.py)"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue