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 5 commits into from Nov 19, 2019

CLI: Add "--strict" option #583

merged 5 commits into from Nov 19, 2019


Copy link

@ubruhin 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).


$ 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 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
@ubruhin ubruhin deleted the add-cli-strict-mode branch Nov 19, 2019
Copy link

@EdizonTN EdizonTN commented on 4b4c8d0 Nov 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link

@rnestler 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?

Copy link

@EdizonTN 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"...



Copy link

@dbrgn 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.

Copy link

@EdizonTN EdizonTN commented Nov 23, 2019

.... a Genuine LibrePCB file :-)

Ok, ok, thanks for an explanation.

ubruhin added a commit that referenced this issue 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
None yet

Successfully merging this pull request may close these issues.

None yet

4 participants