Roald87 / TcBlack

Opnionated code formatter for TwinCAT.
MIT License
103 stars 11 forks source link

Make TcBlackCLI work from every directory and with relative paths #19

Open Roald87 opened 4 years ago

Roald87 commented 4 years ago

Currently TcBlack.exe only works under the following conditions:

  1. build.log needs to be present when executed in non-safe mode.
  2. TcBlack.exe is executed directly from its own folder
  3. All files which should be reformatted are entered with their full paths.
Doctornunu commented 3 years ago

Hi!

Not sure if this is the right place to ask but I fiddled around a bit with the formatter and I couldn't seem to get the formatting to work on the implementation parts of the POUs. I tried to format the .plcproj as well as the .TcPOUs by themselves and I tried all command combinations as well as different directories.

Not quite sure if there's anything I'm missing here as I didn't get any error messages. I've attached a copy of the .TcPOU that I've tried on.

TcPOU.zip

Roald87 commented 3 years ago

Hi @Doctornunu. Formatting of the implementation part of the POU is not implemented yet. It is planned for a future milestone. See also #40.

Doctornunu commented 3 years ago

Oh, I was under the impression that this wasn't the case for "programs" / POUs. I interpreted this quote from the manual as it was only the case for function blocks, functions etc :

Note: Currently TcBlack only formats the declaration part of function blocks, functions, methods, properties and interfaces. Formatting of the implementation is planned for a future release.

Thanks for the answer though, I would love to contribute to the project once (or if) I get .NET + C# running properly in VSCode.

Roald87 commented 3 years ago

Thanks for noting that! I've changed it now.