Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: hook to check for mixed and/or pinned TwinCAT versions #28

Closed
rruiter87 opened this issue Jun 19, 2024 · 3 comments
Closed

Idea: hook to check for mixed and/or pinned TwinCAT versions #28

rruiter87 opened this issue Jun 19, 2024 · 3 comments

Comments

@rruiter87
Copy link
Contributor

We had a discussion here TcOpenGroup/TcOpen#731 about the mixed TwinCAT versions and pinned ones in the tsproj files. Would it be an idea to add another pre-commit to check for this? I can add it.

Something like check-twincat-versions --target-version 4024.22 --pinned

Different cases:

  1. In case of a single project, you can select if it should be pinned and add an optional target version.
  2. For two or more, it can check if all target versions match the targeted one and if they are pinned. If no target version is given, it checks whether more than one version is used.

Optionally, I can also add an --fix option, that would fix --pinned and if a --target-version is given.

@ZLLentz
Copy link
Member

ZLLentz commented Jun 19, 2024

This would get some use from me for sure, it's broadly helpful.

Some scattered thoughts about this:

  • This would be most helpful for repositories with several projects in them (and for catching people accidentally unpinning or changing the version)
  • In some projects this could add friction- you'd have to change the TwinCAT version in two places when you want to update it. But in such cases you simply wouldn't use it.
  • Not to increase scope, but a future extension to this (or separate pre-commit action) could also check for the Project -> Properties -> Advanced -> Write project version in files. I might look into this later if I have time (though I'm not currently working on TwinCAT things)

Unrelated thoughts:

  • Thank you for linking TcOpen to me- I'm not sure how I've managed not to see it before. I've forwarded the docs pages to my team for visibility because it seems like the kind of thing we should be using/contributing to.
  • Is it possible that TcOpenGroup is a more suitable github home for many of these pre-commit hooks? I'm not suggesting an immediate migration, but it's food for thought to make these more community-visible.

@rruiter87
Copy link
Contributor Author

In some projects this could add friction- you'd have to change the TwinCAT version in two places when you want to update it. But in such cases you simply wouldn't use it.

True, but that's not something that happens regularly. Also as you mentioned, you don't have to use it.

Not to increase scope, but a future extension to this (or separate pre-commit action) could also check for the Project -> Properties -> Advanced -> Write project version in files. I might look into this later if I have time (though I'm not currently working on TwinCAT things)

Yeah, I thought about that as well :D. I think that is one that Jakob mentions in his video. Maybe I'll find some time to do this.

Thank you for linking TcOpen to me- I'm not sure how I've managed not to see it before. I've forwarded the docs pages to my team for visibility because it seems like the kind of thing we should be using/contributing to.

The TwinCAT community and projects are growing faster than someone can keep up :). I've started to use it a bit and have mixed feelings. On the one hand it is great that a lot of standard cases are already taken care of. On the other hand, the project is in the alpha phase, there's scarse documentation and it is quite complex, but the people of MTS are very helpfull and put a lot of time and effort into it.

Is it possible that TcOpenGroup is a more suitable github home for many of these pre-commit hooks? I'm not suggesting an immediate migration, but it's food for thought to make these more community-visible.

Maybe, but I think it is find for now. I've been spamming this pre-commit every chance I get ^^.

@ZLLentz
Copy link
Member

ZLLentz commented Jul 2, 2024

closed by #29

@ZLLentz ZLLentz closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants