|
| 1 | += Common Conventions |
| 2 | + |
| 3 | +[NOTE] |
| 4 | +==== |
| 5 | +These guidelines are not yet complete. Help us create sensible conventions |
| 6 | +https://github.com/LibrePCB/librepcb-doc/issues?q=is%3Aissue+label%3A%22Conventions%3A+Symbols%22[on GitHub]! |
| 7 | +==== |
| 8 | + |
| 9 | +The conventions described on this page apply to all kinds of library elements |
| 10 | +(symbols, packages, categories, ...) unless explicitly specified differently |
| 11 | +in the conventions of the corresponding library element type. |
| 12 | + |
| 13 | +== Name |
| 14 | + |
| 15 | +Generally, the capitalization of library element names should be |
| 16 | +https://en.wikipedia.org/wiki/Title_case[Title Case]. If this is not suitable |
| 17 | +in certain cases (e.g. _Schottky Diodes Dual in Series_), the |
| 18 | +corresponding warning from the library check can be approved. |
| 19 | + |
| 20 | +Special Rules: |
| 21 | + |
| 22 | +* *Component categories:* Shall be in *plural form*, not singular (e.g. |
| 23 | + _Diodes_, not _Diode_). |
| 24 | +* *Package categories:* Shall be in *singular form*, not plural (e.g. |
| 25 | + _Chip Resistor_, not _Chip Resistors_). |
| 26 | +* *Packages:* Follow IPC-7351 conventions (see details in |
| 27 | + xref:library-conventions:packages.adoc#naming[Package Naming]). |
| 28 | + |
| 29 | +== Description |
| 30 | + |
| 31 | +If the description of a library element is very obvious from its name (e.g. |
| 32 | +a symbol named _Diode_), the description should be kept empty. If a description |
| 33 | +is needed, its first line (if multiple) should be a short, expressive summary |
| 34 | +about the library element (e.g. _General-purpose 1A/400V rectifier diode in |
| 35 | +DO-41 package_). Any sentence or summary shall end with a period. |
| 36 | + |
| 37 | +== Keywords |
| 38 | + |
| 39 | +* Keywords are *all lowercase, comma-separated, without spaces after the comma*. |
| 40 | + Example: _"soic8,schmitt trigger,inverted"_ |
| 41 | +* Do not add keywords which are already contained in the library elements |
| 42 | + name. For example a symbol called _Schmitt Trigger_ shall not have the |
| 43 | + keyword _"schmitt trigger"_. |
| 44 | +* To decide about keywords, just ask yourself which terms a user might type |
| 45 | + to find that library element, and are not already contained in its name. |
| 46 | + |
| 47 | +== Author |
| 48 | + |
| 49 | +Every library element should have an author. It is allowed to use nicknames |
| 50 | +instead of real names (ideally, it should correspond to your GitHub username |
| 51 | +then). |
| 52 | + |
| 53 | +When making significant changes to an existing library element created by |
| 54 | +someone else, it is allowed/recommended to add your name to the author field |
| 55 | +too, separated by a comma and a space. Example: _"Author 1, Author 2"_ |
| 56 | + |
| 57 | +== Version |
| 58 | + |
| 59 | +* New elements should have the version number 0.1. |
| 60 | +* Every change to a library element shall increase its version number. |
| 61 | +** Metadata-only changes (i.e. information in the _Metadata_ tab/panel): + |
| 62 | + Bump the third digit (e.g. 0.1 -> 0.1.1, or 1.1 -> 1.1.1). |
| 63 | +** Functional changes (graphics, pin names, MPNs, ...): + |
| 64 | + Bump the second digit (e.g. 0.1 -> 0.2, or 1.1 -> 1.2) |
| 65 | +** Huge refactorings / complete rewrites (but still no breaking changes): + |
| 66 | + Bump the first digit (e.g. 0.1 -> 1.0, or 1.2 -> 2.0). This is almost |
| 67 | + never done. |
| 68 | + |
| 69 | +[IMPORTANT] |
| 70 | +==== |
| 71 | +Breaking changes on existing library elements are never allowed! Whenever |
| 72 | +the library editor shows a warning about breaking changes, create a new |
| 73 | +library element instead of breaking an existing one. If the existing element |
| 74 | +shall not be used anymore then, mark it as deprecated. |
| 75 | +==== |
| 76 | + |
| 77 | +[NOTE] |
| 78 | +==== |
| 79 | +Only bump the version number of library elements you have modified. The |
| 80 | +version number of the library which contains that element shall not be |
| 81 | +bumped, unless you made changes to the library itself. Generally, only |
| 82 | +library maintainers bump the verison number of libraries. |
| 83 | +==== |
0 commit comments