Open utterances-bot opened 2 years ago
Regarding to prettier you can tell it what parser to use for an unknown file:
https://prettier.io/docs/en/configuration.html#configuration-overrides
Even if this a bit cumbersome because of:
https://github.com/prettier/prettier/issues/11141
But if you call
Edit 2023-12: The bug was fixed. prettier . ./**/*.theme
this works.
"prettier": {
"overrides": [
{
"files": "*.theme",
"options": {
"parser": "json"
}
}
]
},
@HolgerJeromin Thanks for the tip! I'll try it out.
Nice job with the pre-commits! Do you have any experience / tips regarding pre-build scripts in Twincat XAE?
@larsrod81 glad you like it. I did use post build commands for a project in the past to generate html pages from markdown files. What would you like to do?
Hi, I was planning to use post build command for extracting git info and use this for version info in the PLC. Main problem is that any "Execute" command in Twincat Deployment triggers the windows UAC dialog to pop up and require confirmation. Did you experience the same when generating html pages?
@larsrod81 No I don't think so. We just did start [filename.exe]
in the pre-build commands of the HMI project. I haven't used the Plc Project > Deployment functionality.
No more formatting fights with pre-commits for TwinCAT
Earlier I talked about how you can do version control of your TwinCAT code with git. In this post, I want to show a very neat feature of git which I didn’t mention last time: pre-commits. You can use pre-commits to format, lint, or do static code analyses before you commit your code. Unfortunately, there is currently only one pre-commit for structured text files. But, you can also use pre-commits for markdown, html, or javascript files.
https://cookncode.com/twincat/2022/04/14/pre-commit.html