pcdshub / pre-commit-hooks

Pre-commit hooks for PCDS projects (https://pre-commit.com/)
Other
10 stars 7 forks source link

add product version check pre-commit #24

Closed rruiter87 closed 5 months ago

rruiter87 commented 7 months ago

A pre-commit to check if the product version is saved in the xml file

<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">

It only fails when it detects the Product version. I thought about automatically removing it as well, but this can be easily done with a single click for all files in the project. And I was not sure what it would do if some files have a product version and others not.

rruiter87 commented 5 months ago

gentle ping

ZLLentz commented 5 months ago

Sorry, I've been super busy, I'll circle back here soon

ZLLentz commented 5 months ago

Thank you for your contribution and sorry for the delay!

rruiter87 commented 5 months ago

Strange that it changes some but not all files. I guess you can't share the files to reproduce this issue?

I did a quick google search, but I can't find any related issues. My initial thought was that maybe pre-commit has some limit of the number of files that it makes checks. Or maybe it does check them, but in the output the file list is truncated.

ZLLentz commented 5 months ago

The files are public if you are interested, but I also assume it's something like truncation and am not worrying much. Your code does the right thing for all of these files when applied directly.