-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
61 lines (61 loc) · 2.49 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
53
54
55
56
57
58
59
60
61
exclude: '.*\.(resx|Designer.cs|xti|tcscopex)'
repos:
- repo: https://github.com/pcdshub/pre-commit-hooks.git
rev: v1.7.0
hooks:
# Replace leading tabs with 4 spaces
- id: twincat-leading-tabs-remover
# remove TwinCAT line ID lines
- id: twincat-lineids-remover
# Use lxml to beautify TwinCAT xml files
- id: twincat-xml-format
# Check if all used libraries' version numbers are fixed
- id: check-fixed-library-versions
# Checks if the product version is saved in the TwinCAT source file.
- id: no-product-version
# Affixes newlines to ST segments
- id: twincat-st-newline
# Check if minimize id changes is selected in the plc project file.
# See https://www.youtube.com/watch?v=KKpBtaYjfWo&t=935s why to do this.
- id: minimize-id-changes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 # Use the ref you want to point at
hooks:
# Removes trailing white spaces
- id: trailing-whitespace
# Checks yaml files for parseable syntax
- id: check-yaml
# Prevents git from committing large files
- id: check-added-large-files
- id: end-of-file-fixer
# These files are either edited in the IDE or auto generated. No point in adding a new line at the end.
exclude: '\.(TcPOU|TcDUT|TcTTO|TcGVL|TcGTLO|TcVMO|TcIO|TcVis|plcproj|tsproj|tcdmproj|tcdmdrv|tcmproj|xti|STweep)$'
- id: requirements-txt-fixer
# For this hook you need to have the Stweep.CLI installed and buy a license
# See https://www.stweep.com/stweep-cli-beta-releases/
- repo: local
hooks:
- id: stweep
name: Format TwinCAT files with STweep
entry: python stweep_format.py --settingsFile=settings.STweep
language: python
# All files need to be passed at once, or else the license activation/deactivation fails
require_serial: true
files: '.*\.(TcPOU|TcDUT|TcTTO|TcGVL)'
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
exclude_types: ["svg"]
exclude: "win32_errors.html$"
additional_dependencies:
- "@prettier/[email protected]"
- repo: https://github.com/rruiter87/tcunit-precommit
rev: v0.2.0
hooks:
- id: unittest-name-fixer
# Remove this line to prevent the names to be automatically fixed
args: [--fix]
# Ajust this to how you name your unit tests
files: '.*_Tests\.TcPOU'