Skip to content

Commit 8594b44

Browse files
authored
Merge pull request #2 from Roald87/pre-commit
format with twincat and standard precommits
2 parents 1af5e64 + 91041e5 commit 8594b44

File tree

26 files changed

+130
-105
lines changed

26 files changed

+130
-105
lines changed

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
# These are some pretty standard general pre-commit hooks
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v3.2.0
7+
hooks:
8+
- id: trailing-whitespace # Removes trailing white spaces
9+
- id: check-yaml # checks yaml files for parseable syntax.
10+
- id: check-added-large-files # prevents giant files from being committed.
11+
12+
13+
# These hooks are made specifically for TwinCAT by the people of the Photon Controls and Data Systems at SLAC
14+
- repo: https://github.com/pcdshub/pre-commit-hooks
15+
rev: v1.1.0
16+
hooks:
17+
- id: twincat-leading-tabs-remover # Replaces all leading tabs with spaces
18+
- id: twincat-lineids-remover # Removes line ids. See point 4 of the link for why you don't need them https://cookncode.com/twincat/2021/06/07/tc-source-control-tips#2-creating-independent-files
19+
- id: twincat-xml-format # Formats .tmc and .tpy files
20+
21+
# # Doesnt work for me yet: https://github.com/pre-commit/mirrors-prettier/issues/18
22+
# - repo: https://github.com/pre-commit/mirrors-prettier
23+
# rev: v2.6.0 # Use the sha / tag you want to point at
24+
# hooks:
25+
# - id: prettier

Datagrid/Datagrid/Desktop.view

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
data-tchmi-background-image-height="100" data-tchmi-background-image-width="100"
99
data-tchmi-background-image-height-unit="%" data-tchmi-background-image-width-unit="%">
1010

11-
<div id="ViewDesktopBeckhoffLogo" data-tchmi-type="tchmi-image"
11+
<div id="ViewDesktopBeckhoffLogo" data-tchmi-type="tchmi-image"
1212
data-tchmi-src="Images/Beckhoff_Logo.svg"
13-
data-tchmi-left="20" data-tchmi-top="20"
13+
data-tchmi-left="20" data-tchmi-top="20"
1414
data-tchmi-width="194" data-tchmi-height="57">
1515

1616
</div>

Datagrid/Datagrid/Fonts/Fonts.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@font-face {
2-
font-family: RobotoCondensed;
3-
src: url(Roboto-Condensed-webfont.woff);
4-
}
1+
@font-face {
2+
font-family: RobotoCondensed;
3+
src: url(Roboto-Condensed-webfont.woff);
4+
}
55

66
/**
77
Description about font inclusion in TcHmi
@@ -12,10 +12,10 @@
1212
'Microsoft YaHei' (Windows), 'Hiragino Sans GB' (Mac/iOS), 'Noto Sans CJK SC/TC' (Android), 'WenQuanYi Micro Hei' (Linux) renders chinese
1313
'Meiryo' (Windows), 'Hiragino Kaku Gothic Pro' (Mac/iOS), 'Noto Sans CJK JP' (Android) renders japanese
1414
15-
For other fonts you can add the woff files into the tchmi project and
15+
For other fonts you can add the woff files into the tchmi project and
1616
add a @font-face section yourself
1717
The noto family from google tries to cover all of the world, is free to use and fits nicely with roboto
18-
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
18+
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
1919
2020
The font usage is defined in the main css file of the active theme (for example Themes/Base/Style.css).
2121
*/

Datagrid/Datagrid/Properties/Default.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- STANDARD --
22
<!DOCTYPE html>
33
<!--
4-
Copyright (C) {{YEAR}} {{COMPANYNAME}}
4+
Copyright (C) {{YEAR}} {{COMPANYNAME}}
55
For any information visit: {{COMPANYWEBSITE}}
66
77
Deployment
@@ -31,7 +31,7 @@
3131
</head>
3232
<body>
3333
<noscript style="font-size: large; padding: 50px;">
34-
TwinCAT HMI needs to execute JavaScript Code in the browser.
34+
TwinCAT HMI needs to execute JavaScript Code in the browser.
3535
Please enable JavaScript in this browser to use the HMI.
3636
</noscript>
3737
{{VIEWLEVEL}}
@@ -73,7 +73,7 @@
7373
-- SLAVE --
7474
<!DOCTYPE html>
7575
<!--
76-
Copyright (C) {{YEAR}} {{COMPANYNAME}}
76+
Copyright (C) {{YEAR}} {{COMPANYNAME}}
7777
For any information visit: {{COMPANYWEBSITE}}
7878
7979
Deployment
@@ -96,7 +96,7 @@
9696
</head>
9797
<body>
9898
<noscript style="font-size: large; padding: 50px;">
99-
TwinCAT HMI needs to execute JavaScript Code in the browser.
99+
TwinCAT HMI needs to execute JavaScript Code in the browser.
100100
Please enable JavaScript in this browser to use the HMI.
101101
</noscript>
102102
{{VIEWLEVEL}}

Datagrid/Datagrid/RowClassesProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030

3131
return cssStyles;
3232
};
33-
33+
3434
TcHmi.Functions.registerFunction('RowClassesProvider', RowClassesProvider);
3535
})(TcHmi);

Datagrid/Datagrid/Themes/Base/Style.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
'Microsoft YaHei' (Windows), 'Hiragino Sans GB' (macOS/iOS), 'Noto Sans CJK SC/TC' (Android), 'WenQuanYi Micro Hei' (Linux) renders chinese
88
'Meiryo' (Windows), 'Hiragino Kaku Gothic Pro' (macOS/iOS), 'Noto Sans CJK JP' (Android) renders japanese
99
10-
For other fonts you can add the woff files into the TcHmi project and
10+
For other fonts you can add the woff files into the TcHmi project and
1111
add a @font-face section yourself.
1212
The noto family from Google tries to cover all of the world, is free to use and fits nicely with Roboto
13-
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
13+
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
1414
1515
The font usage is defined in the main CSS file of the active theme (for example Themes/Base/Style.css).
1616
*/
1717

1818
html {
1919
font-family:RobotoCondensed,
20-
'Microsoft YaHei', '微软雅黑',
20+
'Microsoft YaHei', '微软雅黑',
2121
'Hiragino Sans GB', '冬青黑体',
22-
'STXihei', '华文细黑',
22+
'STXihei', '华文细黑',
2323
'WenQuanYi Micro Hei',
24-
'Meiryo', 'メイリオ',
24+
'Meiryo', 'メイリオ',
2525
'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ ProN',
2626
'Noto Sans CJK SC', 'Noto Sans CJK TC', 'Noto Sans CJK JP', 'Noto Sans CJK KR',
2727

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@font-face {
2-
font-family: RobotoCondensed;
3-
src: url(Roboto-Condensed-webfont.woff);
4-
}
1+
@font-face {
2+
font-family: RobotoCondensed;
3+
src: url(Roboto-Condensed-webfont.woff);
4+
}
55

66
/**
77
Description about font inclusion in TcHmi
@@ -12,10 +12,10 @@
1212
'Microsoft YaHei' (Windows), 'Hiragino Sans GB' (Mac/iOS), 'Noto Sans CJK SC/TC' (Android), 'WenQuanYi Micro Hei' (Linux) renders chinese
1313
'Meiryo' (Windows), 'Hiragino Kaku Gothic Pro' (Mac/iOS), 'Noto Sans CJK JP' (Android) renders japanese
1414
15-
For other fonts you can add the woff files into the tchmi project and
15+
For other fonts you can add the woff files into the tchmi project and
1616
add a @font-face section yourself
1717
The noto family from google tries to cover all of the world, is free to use and fits nicely with roboto
18-
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
18+
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
1919
2020
The font usage is defined in the main css file of the active theme (for example Themes/Base/Style.css).
2121
*/

DigitalTwin/Oven/HmiProject/Properties/Default.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- STANDARD --
22
<!DOCTYPE html>
33
<!--
4-
Copyright (C) {{YEAR}} {{COMPANYNAME}}
4+
Copyright (C) {{YEAR}} {{COMPANYNAME}}
55
For any information visit: {{COMPANYWEBSITE}}
66
77
Deployment
@@ -31,7 +31,7 @@
3131
</head>
3232
<body>
3333
<noscript style="font-size: large; padding: 50px;">
34-
TwinCAT HMI needs to execute JavaScript Code in the browser.
34+
TwinCAT HMI needs to execute JavaScript Code in the browser.
3535
Please enable JavaScript in this browser to use the HMI.
3636
</noscript>
3737
{{VIEWLEVEL}}
@@ -73,7 +73,7 @@
7373
-- SLAVE --
7474
<!DOCTYPE html>
7575
<!--
76-
Copyright (C) {{YEAR}} {{COMPANYNAME}}
76+
Copyright (C) {{YEAR}} {{COMPANYNAME}}
7777
For any information visit: {{COMPANYWEBSITE}}
7878
7979
Deployment
@@ -96,7 +96,7 @@
9696
</head>
9797
<body>
9898
<noscript style="font-size: large; padding: 50px;">
99-
TwinCAT HMI needs to execute JavaScript Code in the browser.
99+
TwinCAT HMI needs to execute JavaScript Code in the browser.
100100
Please enable JavaScript in this browser to use the HMI.
101101
</noscript>
102102
{{VIEWLEVEL}}

DigitalTwin/Oven/HmiProject/Themes/Base/Style.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
'Microsoft YaHei' (Windows), 'Hiragino Sans GB' (macOS/iOS), 'Noto Sans CJK SC/TC' (Android), 'WenQuanYi Micro Hei' (Linux) renders chinese
88
'Meiryo' (Windows), 'Hiragino Kaku Gothic Pro' (macOS/iOS), 'Noto Sans CJK JP' (Android) renders japanese
99
10-
For other fonts you can add the woff files into the TcHmi project and
10+
For other fonts you can add the woff files into the TcHmi project and
1111
add a @font-face section yourself.
1212
The noto family from Google tries to cover all of the world, is free to use and fits nicely with Roboto
13-
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
13+
see https://www.google.com/get/noto/ and https://fonts.google.com/earlyaccess
1414
1515
The font usage is defined in the main CSS file of the active theme (for example Themes/Base/Style.css).
1616
*/
1717

1818
html {
1919
font-family:RobotoCondensed,
20-
'Microsoft YaHei', '微软雅黑',
20+
'Microsoft YaHei', '微软雅黑',
2121
'Hiragino Sans GB', '冬青黑体',
22-
'STXihei', '华文细黑',
22+
'STXihei', '华文细黑',
2323
'WenQuanYi Micro Hei',
24-
'Meiryo', 'メイリオ',
24+
'Meiryo', 'メイリオ',
2525
'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ ProN',
2626
'Noto Sans CJK SC', 'Noto Sans CJK TC', 'Noto Sans CJK JP', 'Noto Sans CJK KR',
2727

DigitalTwin/Oven/Oven/PLC/DUTs/Command.TcDUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{attribute 'strict'}
66
TYPE Command :
77
(
8-
Off := 0,
8+
Off := 0,
99
On
1010
);
1111
END_TYPE

0 commit comments

Comments
 (0)