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

CLI: Add "--strict" option #583

Merged
merged 5 commits into from Nov 19, 2019
Merged

CLI: Add "--strict" option #583

merged 5 commits into from Nov 19, 2019

Conversation

@ubruhin
Copy link
Member

ubruhin commented Nov 17, 2019

With the --strict option, the CLI reports files which are not canonical, i.e. files which would be modified when saving the opened project or library element. Useful for continuous integration of libraries, mainly to check library elements which were generated (i.e. not made with LibrePCB).

Example:

$ librepcb-cli open-library LibrePCB_Connectors.lplib --all --strict
Open library 'LibrePCB_Connectors.lplib'...
    - Non-canonical file: LibrePCB_Connectors.lplib/library.lp
Process 0 component categories...
Process 0 package categories...
Process 198 symbols...
Process 514 packages...
Process 198 components...
Process 514 devices...
    - Non-canonical file: LibrePCB_Connectors.lplib/dev/0b53aefa-f8fb-4f31-bfa2-24325a58428b/.librepcb-dev
    - Non-canonical file: LibrePCB_Connectors.lplib/dev/0b53aefa-f8fb-4f31-bfa2-24325a58428b/device.lp
Finished with errors!
@ubruhin ubruhin added the enhancement label Nov 17, 2019
@ubruhin ubruhin added this to the 0.1.3 milestone Nov 17, 2019
@ubruhin ubruhin self-assigned this Nov 17, 2019
@ubruhin ubruhin merged commit ffa210c into master Nov 19, 2019
11 checks passed
11 checks passed
LibrePCB Build #20191117.6 succeeded
Details
LibrePCB (Doxygen) Doxygen succeeded
Details
LibrePCB (Linux Ubuntu_1404_GCC) Linux Ubuntu_1404_GCC succeeded
Details
LibrePCB (Linux Ubuntu_1604_GCC) Linux Ubuntu_1604_GCC succeeded
Details
LibrePCB (Linux Ubuntu_1604_Qt_5_12_3_GCC) Linux Ubuntu_1604_Qt_5_12_3_GCC succeeded
Details
LibrePCB (Linux Ubuntu_1804_Clang) Linux Ubuntu_1804_Clang succeeded
Details
LibrePCB (Linux Ubuntu_1904_GCC9) Linux Ubuntu_1904_GCC9 succeeded
Details
LibrePCB (Stylecheck) Stylecheck succeeded
Details
LibrePCB (macOS) macOS succeeded
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@ubruhin ubruhin deleted the add-cli-strict-mode branch Nov 19, 2019
@EdizonTN

This comment has been minimized.

Copy link

EdizonTN commented on 4b4c8d0 Nov 20, 2019

Please, what do you mean with "canonical / non-canonical" files?
I try to find phrase for translation ...
Thanks

@rnestler

This comment has been minimized.

Copy link
Member

rnestler commented Nov 21, 2019

Please, what do you mean with "canonical / non-canonical" files?

Well @ubruhin mentioned it above: "files which would be modified when saving the opened project or library element".

So other ways to say it may be "non-standard" or "not properly formatted" / "ill-formatted". I guess it is mostly about order and whitespace issues, right @ubruhin?

@EdizonTN

This comment has been minimized.

Copy link

EdizonTN commented Nov 23, 2019

OK, few next questions:
It's, error, warning or notice (LibrePCB can accept this file)?
Can LibrePCB repair these file or not?
It needs some user's action (ex. repair manually)?
Word "canonical" - it's standard for this type of message?

Canonical are occasionaly used in folder/file path string before are unified but in file format.... I don't know (I don't met until now).
Proposals: "corrupted", "bad integrity", "file changed by another process", "bad format"...

Thanks.

_Ed

@dbrgn

This comment has been minimized.

Copy link
Member

dbrgn commented Nov 23, 2019

A non-canonical file is not wrong, it just means that LibrePCB would format it differently. This means that if you change something in a library element that would just affect a single line, the whole file will be reformatted, causing a lot of changes and a large diff in version controlled files.

When you generate your own files for private use, non-canonical files are not a problem at all. When contributing files to the standard library, they should be in canonical format.

@EdizonTN

This comment has been minimized.

Copy link

EdizonTN commented Nov 23, 2019

.... a Genuine LibrePCB file :-)

Ok, ok, thanks for an explanation.

ubruhin added a commit that referenced this pull request Nov 25, 2019
CLI: Add "--strict" option
(cherry picked from commit ffa210c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.