jeremiah-c-leary / vhdl-style-guide

Style guide enforcement for VHDL
GNU General Public License v3.0
182 stars 38 forks source link

Prevent Python from replacing the existing newline characters. #1010

Closed cschlaak closed 10 months ago

cschlaak commented 11 months ago

Prevent Python from replacing the existing newline characters. From the documentation: "... If newline is '' or '\n', no translation takes place ..."

Description My code base is based on unix line endings '\n'. When running VSG on Windows every file is rewritten with windows line endings '\r\n'. This is due to pythons implementation of 'open'. The added newline argument prevents python from replacing the existing line endings.

alonbl commented 11 months ago

We probably need to set up the configuration to enforce a format and not preserve existing and add new ones using a different kind.

jeremiah-c-leary commented 10 months ago

Morning @cschlaak ,

Wondering if I could get some feedback on @alonbl 's proposed implementation in #1012 . I like the idea of using the os default, but being able to override it.

If you do approve, would you be okay with closing this pull request after #1012 has been merged to master? Or would this pull request automatically close if #1012 is merged? Not sure of the best way to handle this situation.

Thanks,

--Jeremy

cschlaak commented 10 months ago

Hi Jeremy, I agree. I think it's better to have the option to override the default os.sep . Thanks for closing the request and for your efforts you put into this project. Best Christof