Added here: - .pre-commit-config.yaml - docs/project/contribution_tools.md - src/scripts/pre-commit-toc.js - CONTRIBUTING.md - proposals/* (just to switch TOC formats) The rest consists of auto-generated fixes. The switch from doctoc to markdown-toc is because doctoc wants to put a TOC in every file, whereas markdown-toc only does it if you have an insertion point. Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
1.7 KiB
Contribution tools
The Carbon language project has a number of tools used to assist in preparing contributions.
Table of contents
pre-commit
We use pre-commit to run various checks. This will automatically run important checks, including formatting.
To set up pre-commit:
- Follow the installation instructions.
- Enable per-repo:
pre-commit install
When modifying or adding pre-commit hooks, please run
pre-commit run --all-files to see what changes.
markdown-toc
pre-commit enabled: markdown-toc will be run by pre-commit, if installed.
We use markdown-toc to provide GitHub-compatible tables of contents for some documents.
If run manually, specify --bullets=- to use Prettier-compatible bullets, or
always run Prettier after markdown-toc.
Prettier
pre-commit enabled: Prettier will be run by pre-commit, if installed.
We use Prettier for formatting. There is an rc file for configuration.
vim-prettier
If you use vim-prettier, it may help
to add to your .virmc:
let g:prettier#config#print_width = '80'
let g:prettier#config#tab_width = '2'
let g:prettier#config#use_tabs = 'false'
let g:prettier#config#prose_wrap = 'always'