Commit Graph

3 Commits

Author SHA1 Message Date
Marek Roszko 0b0a9d92da Force script line endings 2024-01-16 16:03:43 -05:00
Ian McInerney acc3217a95 Renormalize line endings and enforce normalization for all contributors 2020-08-03 23:15:10 +01:00
John Beard a69cdf1793 Formatting: exclude generated files from git formatting hook
Add a .gitattributes files to provide a place to store file
attributes. Add a custom attribute for files that should be under
KiCad style guidelines.

Exclude generated files from the style enforcement. So far:

* bitmap .cpp files
* wxFormBuilder base classes
* Lemon grammars

It's now trivial to add the 'generated' attribute to any such
file.

Putting this into .gitattributes also means it can be retreived
programmatically, by other scripts, git alaises or on the command
line.

Use the attributes to provide a utility script to show or apply
formatting to controlled files (plain git clang-format won't
pick up our custom git attributes). Add details for the script in
the dev docs.

Also modiify the check-format hook to follow the .gitattributes
and only apply to cached (staged for commit) changes. Then you
won't be stopped committing because of bad formatting in unstaged
changed, or uncontrolled files.

Concept and some aspects of the implementation inspired by
CMake commit d5f39a56 [1].

[1]: d5f39a56a4

tool
2019-03-29 15:06:48 +00:00