KiCad / kicad-library-utils

Some scripts for helping with library development
GNU General Public License v3.0
128 stars 92 forks source link

Add lib/dcm line endings check #274

Closed fauxpark closed 5 years ago

fauxpark commented 5 years ago

Fixes #259.

A little bit of a bodge as it will throw the error on every symbol checked, and not once for each file.

fauxpark commented 5 years ago

@evanshultz while you're around, could you chuck this on your list as well? :)

fauxpark commented 5 years ago

fix() was broken in the footprint rule (at least, on macOS' python 2). This new method seems to do the job nicely.

I tried to do the same for the symbol rule, but the SchLib class overwrites some of the now-corrected line endings when it reconstructs the file in save(). Hm...

fauxpark commented 5 years ago

@poeschlr I decided to let schlib.py handle line ending correction for symbols since it already partially does that anyway. fix() doesn't actually do anything but the line endings are still replaced through the parsing/saving methods in SchLib and Documentation.

This should be good to merge, tested on Python 2 and 3 👍

fauxpark commented 5 years ago

@poeschlr this is ready to go (again). It naively assumes Python 3 and --fix errors out harmlessly under Python 2 :)

poeschlr commented 5 years ago

Thanks. Lets test this with travis (I updated travis to 3.6 recently so we should be fine here.)

myfreescalewebpage commented 5 years ago

@poeschlr travis is still running python 2.7 today 2019-30-03........ this cause the checks to fails and it's a big problem to make the reviews...