2016-03-20 02:58:04 +02:00
# Contributing Guide
2017-11-12 16:22:07 +02:00
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub][First PR]
2021-11-27 21:27:00 +02:00
## How to contribute summary
2016-03-20 02:58:04 +02:00
2022-10-17 11:33:40 +02:00
* Fork the project and submit a Pull Request (PR)
2016-03-20 02:58:04 +02:00
* Explain what the PR fixes or improves
* Screenshots for bonus points
* Use sensible commit messages
* If your PR fixes a separate issue number, include it in the commit message
2017-07-28 23:27:19 +02:00
* Use a sensible number of commit messages as well
* e.g. Your PR should not have 100s of commits
2021-11-27 21:27:00 +02:00
## How to add yourself to the contributors (give yourself attribution)
Don't forget to give yourself credit! Make sure you add yourself to the contributors list that will eventually propagate to [NerdFonts.com ](https://nerdfonts.com )
Either:
* Invoke the [@all-contributors bot ](https://allcontributors.org/docs/en/bot/usage ) by commenting on your Pull Request or Issue.
2023-06-01 02:08:18 +02:00
* Shallow clone repo and execute `all-contributors add <YOUR_GITHUB_HANDLE> <CONTRIBUTION_TYPE>`
2021-11-27 21:27:00 +02:00
Common types for this project include: `code` , `doc` , `translation` , `review` .For full list of contribution types see: https://allcontributors.org/docs/en/emoji-key
2016-03-20 02:58:04 +02:00
2020-09-06 20:44:17 +02:00
## Steps for updating an existing font
### 1. Update original (unpatched) version
* Copy and replace the existing unpatched version of the font and any readme and/or license files in the `src/unpatched-fonts/XYZ-font` directory
* e.g. Updating *XYZ Font* , update files in directory `src/unpatched-fonts/xyz/{PUT FONT FILES HERE}`
* Make sure to update the correct subfolders for each font style (e.g. `src/unpatched-fonts/xyz/bold/{BOLD FONT FILES HERE}` )
### 2. Execute basic testing
* Do a basic test with the new font to ensure it patches correctly and generates a new font file, e.g.
2021-01-03 15:40:17 +02:00
* `fontforge --script ./font-patcher src/unpatched-fonts/XYZ/XYZ.ttf --complete`
2020-09-06 20:44:17 +02:00
* Make sure to then delete this new font file if it is in the repository (all patched fonts should be generated in the `patched-fonts` directory)
### 3. Run build scripts
* When fairly satisfied the font patches correctly, run the following scripts in this order:
* Copy all the unpatched readmes to the patched location with additional info on variations appended:
2021-11-18 07:21:23 +02:00
* `cd bin/scripts`
* `./standardize-and-complete-readmes.sh XYZ`
2020-09-06 20:44:17 +02:00
* Patch **all** of the variations/options, e.g.
* `./gotta-patch-em-all-font-patcher\!.sh XYZ`
2017-04-22 05:46:22 +02:00
## Steps for adding a new font or removing an existing font
2016-03-20 02:58:04 +02:00
2017-07-28 23:27:19 +02:00
* For removal of a font skip to [Step #4 ](#4-run-build-scripts )
2017-04-22 05:46:22 +02:00
2017-04-22 14:36:04 +02:00
### 1. Verify license
2016-03-20 02:58:04 +02:00
* Check the license even allows the font to be modified and shared
2017-04-22 05:46:22 +02:00
### 2. Add original (unpatched) version
2020-09-06 20:44:17 +02:00
* Add the unpatched version of the font and any readme and/or license files to the `src/unpatched-fonts/` directory inside a new directory
2017-03-09 06:04:43 +02:00
* e.g. Adding *XYZ Font* , create directory `src/unpatched-fonts/xyz/{PUT FONT FILES HERE}`
2017-12-08 05:45:45 +02:00
* Try to make subfolders for each font style (e.g. `src/unpatched-fonts/xyz/bold/{BOLD FONT FILES HERE}` )
2017-04-22 14:36:04 +02:00
### 3. Execute basic testing
2016-03-20 02:58:04 +02:00
* Do a basic test with the new font to ensure it patches correctly and generates a new font file, e.g.
2021-01-03 15:40:17 +02:00
* `fontforge --script ./font-patcher src/unpatched-fonts/XYZ/XYZ.ttf --complete`
2017-04-22 05:34:27 +02:00
* Make sure to then delete this new font file if it is in the repository (all patched fonts should be generated in the `patched-fonts` directory)
2017-04-22 05:46:22 +02:00
### 4. Run build scripts
2017-04-22 05:34:27 +02:00
* When fairly satisfied the font patches correctly, run the following scripts in this order:
* Copy all the unpatched readmes to the patched location with additional info on variations appended:
* `./standardize-and-complete-readmes.sh`
* Patch **all** of the variations/options, e.g.
* `./gotta-patch-em-all-font-patcher\!.sh XYZ`
2017-04-22 05:46:22 +02:00
### 5. Update readme
2017-04-22 14:36:04 +02:00
* Add the new font to the table of [Patched Fonts][]
2017-04-22 05:34:27 +02:00
* Update the "counts" in the [Features Section][]
* You can get this information by simply passing a second param to the "all patcher": `./gotta-patch-em-all-font-patcher\!.sh "" info`
* "`X` already patched font families" -> Give exact number from 'typefaces' line
* "Over `X` unique combinations/variations..." -> round down to nearest hundred from 'variation' line
* "Over `X` glyphs/icons combined" -> manual process for now (@todo)
2017-04-22 14:36:04 +02:00
* Update the "counts" in the [Combinations Section][]
* Again, get this info from the "all patcher"
2016-03-20 02:58:04 +02:00
## Things to keep in mind
2017-04-22 06:02:43 +02:00
* Smaller Pull Requests are likely to be merged more quickly than bigger changes
* This project is using a [KISS Workflow][]
2022-10-17 11:33:40 +02:00
* Pull Requests and bugfixes are directly merged into the default branch after sanity testing
* The default branch is basically consider the main developer branch
* We no longer wait to get changes into the default branch when there is a release/milestone/version!
2017-04-22 06:02:43 +02:00
* the release branches and version tags are considered stable and frozen
2016-03-20 02:58:04 +02:00
* This project is using [Semantic Versioning 2.0.0 ](http://semver.org/ )
2017-04-22 06:02:43 +02:00
* If a bugfix or PR is *not* trivial it will likely end up in the next **MINOR** version
* If a bugfix or PR *is* trivial *or* critical it will likely end up in the next **PATCH** version
* Useful Pull Requests **will** get merged in eventually
2017-04-22 14:36:04 +02:00
* [E.g. see how many have already been merged vs. still open][pulls]
2016-03-20 02:58:04 +02:00
## Commit messages
2017-04-22 06:02:43 +02:00
* Squashing to 1 commit is **not** required at this time
* Use sensible commit messages (when in doubt: `git log` )
2017-07-28 23:27:19 +02:00
* Use a sensible number of commit messages
2017-04-22 06:02:43 +02:00
* If your PR fixes a specific issue number, include it in the commit message: `"Fixes XYZ error (fixes #123)"`
2016-03-20 02:58:04 +02:00
2017-04-11 03:31:10 +02:00
## Code standards
2016-03-20 02:58:04 +02:00
2017-04-11 03:31:10 +02:00
### Shell Scripts
* Follow [ShellCheck ](https://github.com/koalaman/shellcheck ) - A shell script static analysis tool
* Try to follow [Google's Shell Style Guide ](https://google.github.io/styleguide/shell.xml )
### Python
* Use 4 spaces for indentation
* Consider PEP8 and other (@todo)
2017-04-22 05:34:27 +02:00
<!-- link references -->
2017-04-22 14:36:04 +02:00
[pulls]: https://github.com/ryanoasis/nerd-fonts/pulls
2022-10-17 11:33:40 +02:00
[Features Section]: https://github.com/ryanoasis/nerd-fonts/blob/-/readme.md#features
[Combinations Section]: https://github.com/ryanoasis/nerd-fonts/blob/-/readme.md#combinations
[Patched Fonts]: https://github.com/ryanoasis/nerd-fonts/blob/-/readme.md#patched-fonts
2017-04-22 06:02:43 +02:00
[KISS Workflow]: https://github.com/ryanoasis/nerd-fonts/wiki/Development-Workflow#kiss-workflow
2022-10-12 09:05:23 +02:00
[First PR]: https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github