forked from freeorion/freeorion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
52 lines (52 loc) · 1.7 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
default_stages:
- commit
- manual
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8/
rev: 4.0.1
# We have multiple places where Python code is located
# The main 3 points are:
# - AI (default/python)
# - Game rules (default/scripting)
# - Scripting tests (test-scripting)
# Each of them has own flake8 config
# Other files shares the same config as AI
# To addres this structure we run flake8 3 times with different set of excludes
hooks:
- id: flake8
name: flake8 for AI
args:
- --extend-exclude=default/scripting/*,test-scripting/*
- --config=default/python/tox.ini
- id: flake8
name: flake8 for scripting
args:
- --extend-exclude=default/python/*,test-scripting/*,cmake/*,doc/*,check/*
- --config=default/scripting/tox.ini
- id: flake8
name: flake8 for test-scripting
args:
- --extend-exclude=default/python/*,default/scripting/*,cmake/*,doc/*,check/*
- --config=test-scripting/tox.ini
- repo: local
hooks:
- id: string-tables-syntax-check
name: String tables syntax check
description: This hook will do lighwight stringtables checks
entry: python check/st-tool.py check --reference default/stringtables/en.txt
language: python
files: 'default/stringtables/[a-z]{2}\.txt'
types: [ text ]