Skip to content

Commit eb611da

Browse files
authored
Merge pull request #21 from klauer/enh_pytmc_pragmalint
ENH: add pytmc pragmalint pre-commit hook
2 parents b7301c5 + 53c5e35 commit eb611da

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.pre-commit-hooks.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@
3333
entry: check-fixed-library-versions
3434
language: python
3535
files: .*\.plcproj$
36+
- id: pytmc-pragma-linter
37+
name: pytmc-pragma-linter
38+
description: Lint pytmc pragmas
39+
entry: bash -c 'set -ex; for fn in "$@"; do pytmc pragmalint "$fn"; done' --
40+
language: python
41+
files: .*\.(TcPOU|TcGVL|TcDUT)$
42+
additional_dependencies: ["pytmc"]

forTwinCatRepos/.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ repos:
1515
- id: twincat-lineids-remover
1616
- id: twincat-xml-format
1717
- id: check-fixed-library-versions
18+
# Optional, if you use pytmc to generate EPICS IOCs:
19+
# - id: pytmc-pragma-linter

0 commit comments

Comments
 (0)