Add files and configuration for filters
Changes to be committed:
modified: .gitattributes
modified: bitbucket-pipelines.yml
new file: filter/cleanCode.sed
new file: filter/gitconfig
new file: filter/ignoreTargetNetId.sed
This commit is contained in:
19
.gitattributes
vendored
19
.gitattributes
vendored
@@ -11,8 +11,23 @@
|
||||
|
||||
# Tc files must be CRLF
|
||||
*.plcproj text eol=crlf
|
||||
*.Tc* text eol=crlf
|
||||
*.tsproj text eol=crlf
|
||||
*.Tc* text eol=crlf filter=cleanCode
|
||||
*.tsproj text eol=crlf filter=ignoreNetId
|
||||
*.txt text eol=crlf
|
||||
*.xml text eol=crlf
|
||||
*.xti text eol=crlf
|
||||
|
||||
|
||||
# Configure the following in TwinCAT:
|
||||
# TOOLS -> Options -> TwinCAT -> PLC Environment -> Write Options -> Separate LineIDS : True
|
||||
# To activate the filter, run
|
||||
#git config filter.ignoreNetId.clean 'sed -b -f filter/ignoreTargetNetId.sed'
|
||||
#git config filter.cleanCode.clean 'sed -b -f filter/cleanCode.sed'
|
||||
|
||||
# the check if the filter is there by running
|
||||
# cat ../../../../.git/modules/solution/tc_project_app/tc_pils/tc_pils_generic/config
|
||||
|
||||
#[filter "ignoreNetId"]
|
||||
# clean = sed -f filter/ignoreTargetNetId.sed
|
||||
#[filter "cleanCode"]
|
||||
# clean = sed -f filter/cleanCode.sed
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
image: python:3.7.3
|
||||
options:
|
||||
max-time: 1
|
||||
pipelines:
|
||||
default:
|
||||
- step:
|
||||
script:
|
||||
- git submodule update --init
|
||||
- python twincat_version_manager.py
|
||||
- python check_fix_white_space.py
|
||||
- ./check_no_lineids.sh
|
||||
- ./check_code_before_sq_brackets.sh
|
||||
|
||||
image: python:3.7.3
|
||||
options:
|
||||
max-time: 1
|
||||
pipelines:
|
||||
default:
|
||||
- step:
|
||||
script:
|
||||
- git submodule update --init
|
||||
- python twincat_version_manager.py
|
||||
- python check_fix_white_space.py
|
||||
- ./check_no_lineids.sh
|
||||
- ./check_code_before_sq_brackets.sh
|
||||
|
||||
|
||||
10
filter/cleanCode.sed
Normal file
10
filter/cleanCode.sed
Normal file
@@ -0,0 +1,10 @@
|
||||
# remove LineIds
|
||||
/<LineId/d
|
||||
/<\/LineId/d
|
||||
# Add a line after ]]
|
||||
/.\]\]>/s/]]>/\r\n]]>/g
|
||||
# convert tab to space
|
||||
/\t/s/\t/ /g
|
||||
# remove trailing space
|
||||
s/[[:blank:]]*$//
|
||||
s/[[:blank:]]*\r$/\r/
|
||||
5
filter/gitconfig
Normal file
5
filter/gitconfig
Normal file
@@ -0,0 +1,5 @@
|
||||
[filter "ignoreNetId"]
|
||||
clean = sed -b -f filter/ignoreTargetNetId.sed
|
||||
[filter "cleanCode"]
|
||||
clean = sed -b -f filter/cleanCode.sed
|
||||
|
||||
1
filter/ignoreTargetNetId.sed
Normal file
1
filter/ignoreTargetNetId.sed
Normal file
@@ -0,0 +1 @@
|
||||
s/}\" TargetNetId=\"[0-9.]+\"/}\" /g
|
||||
Reference in New Issue
Block a user