|
| 1 | +# Contributing # |
| 2 | + |
| 3 | +This guide is a _work in progress_, PR's welcome! |
| 4 | + |
| 5 | +TODO |
| 6 | + |
| 7 | +## Issues ## |
| 8 | + |
| 9 | +TODO |
| 10 | + |
| 11 | +## Pull-requests ## |
| 12 | + |
| 13 | +TODO |
| 14 | + |
| 15 | +## Development environment ## |
| 16 | + |
| 17 | +Setting up a local development environment in Linux. Pull-requests welcome for |
| 18 | +MacOS support. (Although, this _is_ the "Linux Upskill Challenge", why not Linux?) |
| 19 | + |
| 20 | +### Python environment ### |
| 21 | + |
| 22 | +Setting up a local python virtual environment is recommended. |
| 23 | + |
| 24 | +```bash |
| 25 | +python3 -m venv .env |
| 26 | +``` |
| 27 | + |
| 28 | +Install python development environment dependencies. |
| 29 | + |
| 30 | +```bash |
| 31 | +python3 -m pip install -r requirements-dev.txt |
| 32 | +``` |
| 33 | + |
| 34 | +Activate the python environment: |
| 35 | + |
| 36 | +```bash |
| 37 | +source .env/bin/activate |
| 38 | +``` |
| 39 | + |
| 40 | +### NodeJS ### |
| 41 | + |
| 42 | +The markdown linter that's used by this project is an npm package. Install |
| 43 | +markdown lint dependencies from the `package.json` file. |
| 44 | + |
| 45 | +```bash |
| 46 | +npm install |
| 47 | +``` |
| 48 | + |
| 49 | +## Linting ## |
| 50 | + |
| 51 | +Linters: |
| 52 | + |
| 53 | +* [yamllint](https://yamllint.readthedocs.io/en/stable/index.html) |
| 54 | +* [markdownlint](https://github.com/DavidAnson/markdownlint) |
| 55 | +* [ShellCheck](https://github.com/koalaman/shellcheck) |
| 56 | + * Via [shellcheck-py](https://github.com/shellcheck-py/shellcheck-py). It's |
| 57 | + easier to manage this project dependency as a pip-installable package. Also, |
| 58 | + pre-commit uses shellcheck-py because the native ShellCheck pre-commit hook |
| 59 | + has an annoying Docker dependency. |
| 60 | + |
| 61 | +### Pre-commit ### |
| 62 | + |
| 63 | +* [pre-commit](https://pre-commit.com/) |
| 64 | + |
| 65 | +If you setup your python development environment by installing pip packages |
| 66 | +from `requirements-dev.txt` earlier then `pre-commit` should already be |
| 67 | +installed in your python environment. |
| 68 | + |
| 69 | +Pre-commit runs linting, syntax, and other checks via git hook scripts that |
| 70 | +run before code is committed. |
| 71 | + |
| 72 | +Install pre-commit and the hook scripts defined in `.pre-commit-config.yaml`: |
| 73 | + |
| 74 | +```bash |
| 75 | +pre-commit install && pre-commit install-hooks |
| 76 | +``` |
| 77 | + |
| 78 | +Pre-commit will now run prior to committing any code with git. |
| 79 | + |
| 80 | +To manually run the hook scripts and lint the repo: |
| 81 | + |
| 82 | +```bash |
| 83 | +pre-commit |
| 84 | +# or run for all files |
| 85 | +pre-commit run --all-files |
| 86 | +``` |
| 87 | + |
| 88 | +## Build ## |
| 89 | + |
| 90 | +This project uses the [MkDocs](https://www.mkdocs.org/) Python static site |
| 91 | +generator geared towards building project docs. It uses the |
| 92 | +[mkdocs-material](https://github.com/squidfunk/mkdocs-material) theme. |
| 93 | + |
| 94 | +If you setup your Python environment above, then the mkdocs and mkdocs-material |
| 95 | +packages should already be installed. |
| 96 | + |
| 97 | +A local instance of the site can be built and served via localhost by running... |
| 98 | + |
| 99 | +```bash |
| 100 | +mkdocs server |
| 101 | +``` |
| 102 | + |
| 103 | +...from the project root directory. |
| 104 | + |
| 105 | +Served from localhost: [LUC @localhost](http://127.0.0.1:8000) |
| 106 | + |
| 107 | +### GitHub Actions workflows ### |
| 108 | + |
| 109 | +Stages: |
| 110 | + |
| 111 | +* Validate |
| 112 | +* Build & Deploy |
| 113 | + |
| 114 | +TODO: Flesh out this section. |
0 commit comments