-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from rruiter87/minimize-id-changes
Minimize id changes
- Loading branch information
Showing
11 changed files
with
260 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import argparse | ||
import xml.etree.ElementTree as ET | ||
from importlib.abc import Traversable | ||
from typing import Union | ||
|
||
|
||
class PreCommitException(Exception): | ||
pass | ||
|
||
|
||
def minimize_id_changes_checked(filename: Union[Traversable, str]) -> None: | ||
tree = ET.parse(filename) | ||
root = tree.getroot() | ||
|
||
combine_ids_element = root.find('.//{*}CombineIds') | ||
|
||
if combine_ids_element is None or combine_ids_element.text.lower() == 'false': | ||
raise PreCommitException( | ||
f"Minimize id changes not checked in {filename}. " | ||
f"To enable this go to Project settings > Common and select 'Minimize Id changes in TwinCAT files.'") | ||
|
||
|
||
def main(args=None): | ||
if args is None: | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('filenames', nargs='*') | ||
args = parser.parse_args() | ||
try: | ||
for filename in args.filenames: | ||
minimize_id_changes_checked(filename) | ||
return 0 | ||
except Exception as exc: | ||
print(exc) | ||
return 1 | ||
|
||
|
||
if __name__ == "__main__": | ||
exit(main()) |
Empty file.
Empty file.
94 changes: 94 additions & 0 deletions
94
pre_commit_hooks/tests/data/minimize-id-changes-enabled.plcproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<FileVersion>1.0.0.0</FileVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{1361c63e-c3f2-4555-94a3-e0395dcf0a4c}</ProjectGuid> | ||
<SubObjectsSortedByName>True</SubObjectsSortedByName> | ||
<DownloadApplicationInfo>true</DownloadApplicationInfo> | ||
<WriteProductVersion>true</WriteProductVersion> | ||
<GenerateTpy>false</GenerateTpy> | ||
<Name>PLC</Name> | ||
<ProgramVersion>3.1.4024.0</ProgramVersion> | ||
<Application>{83206d8f-62b4-4fa8-ab05-c17a527dee56}</Application> | ||
<TypeSystem>{a1a8971a-d41a-466d-9815-2a15bc6b2b6a}</TypeSystem> | ||
<Implicit_Task_Info>{73d4ce07-8d5e-4312-9201-83b075010509}</Implicit_Task_Info> | ||
<Implicit_KindOfTask>{3f7c3e20-243c-4cff-be01-d0b2a5768750}</Implicit_KindOfTask> | ||
<Implicit_Jitter_Distribution>{342ed85c-270a-468b-aba0-643e68b731fd}</Implicit_Jitter_Distribution> | ||
<LibraryReferences>{a0dc4117-ad2d-4e28-9ee2-42c77070a57d}</LibraryReferences> | ||
<Released>false</Released> | ||
<CombineIds>true</CombineIds> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="PlcTask.TcTTO"> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="POUs\MAIN.TcPOU"> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="DUTs" /> | ||
<Folder Include="GVLs" /> | ||
<Folder Include="VISUs" /> | ||
<Folder Include="POUs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PlaceholderReference Include="Tc2_Standard"> | ||
<DefaultResolution>Tc2_Standard, * (Beckhoff Automation GmbH)</DefaultResolution> | ||
<Namespace>Tc2_Standard</Namespace> | ||
</PlaceholderReference> | ||
<PlaceholderReference Include="Tc2_System"> | ||
<DefaultResolution>Tc2_System, * (Beckhoff Automation GmbH)</DefaultResolution> | ||
<Namespace>Tc2_System</Namespace> | ||
</PlaceholderReference> | ||
<PlaceholderReference Include="Tc3_Module"> | ||
<DefaultResolution>Tc3_Module, * (Beckhoff Automation GmbH)</DefaultResolution> | ||
<Namespace>Tc3_Module</Namespace> | ||
</PlaceholderReference> | ||
<PlaceholderReference Include="TcUnit"> | ||
<DefaultResolution>TcUnit, * (www.tcunit.org)</DefaultResolution> | ||
</PlaceholderReference> | ||
</ItemGroup> | ||
<ProjectExtensions> | ||
<PlcProjectOptions> | ||
<XmlArchive> | ||
<Data> | ||
<o xml:space="preserve" t="OptionKey"> | ||
<v n="Name">"<ProjectRoot>"</v> | ||
<d n="SubKeys" t="Hashtable" ckt="String" cvt="OptionKey"> | ||
<v>{192FAD59-8248-4824-A8DE-9177C94C195A}</v> | ||
<o> | ||
<v n="Name">"{192FAD59-8248-4824-A8DE-9177C94C195A}"</v> | ||
<d n="SubKeys" t="Hashtable" /> | ||
<d n="Values" t="Hashtable" /> | ||
</o> | ||
<v>{8F99A816-E488-41E4-9FA3-846536012284}</v> | ||
<o> | ||
<v n="Name">"{8F99A816-E488-41E4-9FA3-846536012284}"</v> | ||
<d n="SubKeys" t="Hashtable" /> | ||
<d n="Values" t="Hashtable" /> | ||
</o> | ||
<v>{40450F57-0AA3-4216-96F3-5444ECB29763}</v> | ||
<o> | ||
<v n="Name">"{40450F57-0AA3-4216-96F3-5444ECB29763}"</v> | ||
<d n="SubKeys" t="Hashtable" /> | ||
<d n="Values" t="Hashtable" ckt="String" cvt="String"> | ||
<v>ActiveVisuProfile</v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LBAMAAAAFAAAADQAAAAAAAADQHh8tINAhIhoCRSMkAtAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAAAAANADAS0n0CgBLRHQKQEtENAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAQAAANADAS0n0CgBLRHQKQEtEJoqKwFFAAEC0AABLSzQAAEtF9AAHy0t0C4vGgPQMAutAQAAANAxC60XAAAA0DIarQDQMy8aA9AwC60CAAAA0DELrQMAAADQMhqtANA0Gq0A0DUarQA=</v> | ||
</d> | ||
</o> | ||
</d> | ||
<d n="Values" t="Hashtable" /> | ||
</o> | ||
</Data> | ||
<TypeList> | ||
<Type n="Hashtable">System.Collections.Hashtable</Type> | ||
<Type n="OptionKey">{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}</Type> | ||
<Type n="String">System.String</Type> | ||
</TypeList> | ||
</XmlArchive> | ||
</PlcProjectOptions> | ||
</ProjectExtensions> | ||
</Project> | ||
|
92 changes: 92 additions & 0 deletions
92
pre_commit_hooks/tests/data/no-minimize-id-changes.plcproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<FileVersion>1.0.0.0</FileVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{1361c63e-c3f2-4555-94a3-e0395dcf0a4c}</ProjectGuid> | ||
<SubObjectsSortedByName>True</SubObjectsSortedByName> | ||
<DownloadApplicationInfo>true</DownloadApplicationInfo> | ||
<WriteProductVersion>true</WriteProductVersion> | ||
<GenerateTpy>false</GenerateTpy> | ||
<Name>PLC</Name> | ||
<ProgramVersion>3.1.4024.0</ProgramVersion> | ||
<Application>{83206d8f-62b4-4fa8-ab05-c17a527dee56}</Application> | ||
<TypeSystem>{a1a8971a-d41a-466d-9815-2a15bc6b2b6a}</TypeSystem> | ||
<Implicit_Task_Info>{73d4ce07-8d5e-4312-9201-83b075010509}</Implicit_Task_Info> | ||
<Implicit_KindOfTask>{3f7c3e20-243c-4cff-be01-d0b2a5768750}</Implicit_KindOfTask> | ||
<Implicit_Jitter_Distribution>{342ed85c-270a-468b-aba0-643e68b731fd}</Implicit_Jitter_Distribution> | ||
<LibraryReferences>{a0dc4117-ad2d-4e28-9ee2-42c77070a57d}</LibraryReferences> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="PlcTask.TcTTO"> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="POUs\MAIN.TcPOU"> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="DUTs" /> | ||
<Folder Include="GVLs" /> | ||
<Folder Include="VISUs" /> | ||
<Folder Include="POUs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PlaceholderReference Include="Tc2_Standard"> | ||
<DefaultResolution>Tc2_Standard, * (Beckhoff Automation GmbH)</DefaultResolution> | ||
<Namespace>Tc2_Standard</Namespace> | ||
</PlaceholderReference> | ||
<PlaceholderReference Include="Tc2_System"> | ||
<DefaultResolution>Tc2_System, * (Beckhoff Automation GmbH)</DefaultResolution> | ||
<Namespace>Tc2_System</Namespace> | ||
</PlaceholderReference> | ||
<PlaceholderReference Include="Tc3_Module"> | ||
<DefaultResolution>Tc3_Module, * (Beckhoff Automation GmbH)</DefaultResolution> | ||
<Namespace>Tc3_Module</Namespace> | ||
</PlaceholderReference> | ||
<PlaceholderReference Include="TcUnit"> | ||
<DefaultResolution>TcUnit, * (www.tcunit.org)</DefaultResolution> | ||
</PlaceholderReference> | ||
</ItemGroup> | ||
<ProjectExtensions> | ||
<PlcProjectOptions> | ||
<XmlArchive> | ||
<Data> | ||
<o xml:space="preserve" t="OptionKey"> | ||
<v n="Name">"<ProjectRoot>"</v> | ||
<d n="SubKeys" t="Hashtable" ckt="String" cvt="OptionKey"> | ||
<v>{192FAD59-8248-4824-A8DE-9177C94C195A}</v> | ||
<o> | ||
<v n="Name">"{192FAD59-8248-4824-A8DE-9177C94C195A}"</v> | ||
<d n="SubKeys" t="Hashtable" /> | ||
<d n="Values" t="Hashtable" /> | ||
</o> | ||
<v>{8F99A816-E488-41E4-9FA3-846536012284}</v> | ||
<o> | ||
<v n="Name">"{8F99A816-E488-41E4-9FA3-846536012284}"</v> | ||
<d n="SubKeys" t="Hashtable" /> | ||
<d n="Values" t="Hashtable" /> | ||
</o> | ||
<v>{40450F57-0AA3-4216-96F3-5444ECB29763}</v> | ||
<o> | ||
<v n="Name">"{40450F57-0AA3-4216-96F3-5444ECB29763}"</v> | ||
<d n="SubKeys" t="Hashtable" /> | ||
<d n="Values" t="Hashtable" ckt="String" cvt="String"> | ||
<v>ActiveVisuProfile</v> | ||
<v>IR0whWr8bwfwBwAAiD2qpQAAAABVAgAA37x72QAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDBUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgA0AC4ANwAFFlAAcgBvAGYAaQBsAGUARABhAHQAYQAGTHsAMQA2AGUANQA1AGIANgAwAC0ANwAwADQAMwAtADQAYQA2ADMALQBiADYANQBiAC0ANgAxADQANwAxADMAOAA3ADgAZAA0ADIAfQAHEkwAaQBiAHIAYQByAGkAZQBzAAhMewAzAGIAZgBkADUANAA1ADkALQBiADAANwBmAC0ANABkADYAZQAtAGEAZQAxAGEALQBhADgAMwAzADUANgBhADUANQAxADQAMgB9AAlMewA5AGMAOQA1ADgAOQA2ADgALQ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iAGkAbABpAHQAeQDQAAIaA9ADAS0E0AUGGgfQBwgaAUUHCQjQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtDtAPAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60BAAAA0A0BLRHQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0S0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAUAAAA0AwLrQIAAADQDQEtE9APAS0Q0AAJGgRFCgsEAwAAAAUAAAANAAAAAAAAANAMC60CAAAA0A0BLRTQDwEtENAACRoERQoLBAMAAAAFAAAADQAAAAAAAADQDAutAgAAANANAS0V0A8BLRDQAAkaBEUKCwQDAAAABQAAAA0AAAAAAAAA0AwLrQIAAADQDQEtFtAPAS0X0AAJGgRFCgsEAwAAAAUAAAANAAAAKAAAANAMC60EAAAA0A0BLRjQDwEtENAZGq0BRRscAdAAHBoCRR0LBAMAAAAFAAAADQAAAAAAAADQHh8tINAhIhoCRSMkAtAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAAAAANADAS0n0CgBLRHQKQEtENAAJRoFRQoLBAMAAAADAAAAAAAAAAoAAADQJgutAQAAANADAS0n0CgBLRHQKQEtEJoqKwFFAAEC0AABLSzQAAEtF9AAHy0t0C4vGgPQMAutAQAAANAxC60XAAAA0DIarQDQMy8aA9AwC60CAAAA0DELrQMAAADQMhqtANA0Gq0A0DUarQA=</v> | ||
</d> | ||
</o> | ||
</d> | ||
<d n="Values" t="Hashtable" /> | ||
</o> | ||
</Data> | ||
<TypeList> | ||
<Type n="Hashtable">System.Collections.Hashtable</Type> | ||
<Type n="OptionKey">{54dd0eac-a6d8-46f2-8c27-2f43c7e49861}</Type> | ||
<Type n="String">System.String</Type> | ||
</TypeList> | ||
</XmlArchive> | ||
</PlcProjectOptions> | ||
</ProjectExtensions> | ||
</Project> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from importlib.resources import files | ||
|
||
import pre_commit_hooks.tests.data as test_data | ||
import pytest | ||
from pre_commit_hooks.minimize_id_changes import (PreCommitException, | ||
minimize_id_changes_checked) | ||
|
||
|
||
def test_missing_minimize_id_changes(): | ||
plcproj_filename = files(test_data).joinpath("no-minimize-id-changes.plcproj") | ||
|
||
with pytest.raises(PreCommitException): | ||
minimize_id_changes_checked(plcproj_filename) | ||
|
||
|
||
def test_enabled_minimize_id_changes(): | ||
plcproj_filename = files(test_data).joinpath("minimize-id-changes-enabled.plcproj") | ||
|
||
# Doesnt raise PreCommitException | ||
minimize_id_changes_checked(plcproj_filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
lxml | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters