# Contributing

This library is supposed to reflect the active state of the Fab Inventory. Some legacy parts might be there, but generally the idea is to keep the library simple and easy to use for beginners. Keep that in mind when you have that one fancy exotic superpart that you def wanna add.

## How Do I...

Easy...

1. Clone or `git pull` the latest version of the library from here.

1. Add a symbol first and check if there is a generic footprint (e.g. SOIC-8) available before creating a new one.

1. Add manufacturer ID number to the keywords field of the symbol you are adding. It is used by the repository CI tests to compare all schematic parts with the electronics parts list in the [Fab Inventory](http://inventory.fabcloud.io/). The test script can be found in the `tests` directory. Refer to the `.gitlab-ci.yml` file for more details.

1. Please follow the [KiCad Library Convention](https://klc.kicad.org/) before contributing. The official KiCad library is split into categories such as connectors, motor drivers, LEDs. The future of the Fab library is that. For now category name is used as a prefix, for example "LED_" or "MotorDriver_". Then we use the manufacturer name and the product number of the part (not the DigiKey one, but the actual manufacturer number).

1. Whenever adding a new part, use official [KiCad Library Utilities](https://github.com/kicad/kicad-library-utils) to check and fix libraries. There are some things that are not fully respected, such as using rounded rects for rectangular footprints. We use regular rects due to compatibility with some PCB milling tool path generating software. 

1. At the moment we skip checking the PWR_FLAG symbol as KLC says it should have a power input pin, but in official KiCad libraries it has power output pin. Use the following to skip it.  
   ```
   ./check_symbol.py ../../fab.kicad_sym -p '^(?!.*PWR_FLAG).*$' -vs
   ```
   Notice the regex.

1. Do a `git push` to the repository if you have access or use the merge request feature. If you do not know what a merge request is, read about [GitLab merge requests here](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html).

## 3D Models

Yes, we need 3D models of all parts! How else you will get those beautiful board renderings? It would be nice to have original Fab designs, with a little logo or something fun on them. Bright colors could be interesting. Funky textures. You got the idea. Follow official [KiCad 3D Model Guidelines](https://klc.kicad.org/model/m2/m2.1/) for technical details. At the moment there is an additional folder `fab.3dsources` which is intended for FreeCAD source files. Not sure if it will remain in future versions of the library.