Library Conventions | KiCad EDA

Version 3.0.43

Library maintainer rules & guidelines

G1.7 Library files use Unix style line endings

Library files must always be commited to GitLab using Unix-style line endings. This means that lines are terminated using the LF (line feed) character, rather than the DOS style CR+LF line endings.

KiCad library files must be compatible across multiple operating systems, and users should be able to contribute without generating unnecessary noise in the files by constantly changing line endings.

When using the KiCad libraries on a Windows PC, the line endings in the library files may be automatically converted to CR+LF. This is fine, as long as any contributions made to the libraries observe the LF line ending requirements.

This issue is addressed by insisting that all KiCad libraries include a .gitattributes file. This file ensures that the line endings are automatically converted by Git.

An example of a simple .gitattributes file which ensures footprint files have correct line endings is as follows:

*.kicad_mod text=auto

Note: The KiCad library repositories should already have the correct .gitattributes file in place to achieve this