-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README and CONTRIBUTING guidelines #98
Draft
ioreka
wants to merge
6
commits into
main
Choose a base branch
from
update-contributing-and-readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+85
−53
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c9139cd
Update jobs link from octo to kraken
ioreka 53e4980
First TW pass over the CONTRIB page
ioreka 8c48af5
Fix typo and failing tests
ioreka 6dd550c
Linting to fix failing test
ioreka 8953244
Rejig the contributing guide
codeinthehole 6b2068f
Add clarification about Docker installation
ioreka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
*.yml | ||
*.yaml | ||
*.json | ||
.pytest_cache/ | ||
.circleci/ | ||
.prettierignore | ||
.spelling | ||
makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ sendgrid | |
stylelint | ||
vscode | ||
webtest | ||
homebrew | ||
markdownlint | ||
|
||
# Terminology | ||
ORM-constructs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,106 @@ | ||
# Contributing | ||
|
||
Markdown code in this repo must pass several static analysis tests, which are | ||
detailed below. Note that you can run: | ||
You're welcome to suggest changes if you spot a broken link or typo. Clone the | ||
repo or use the GitHub UI to make a pull request. | ||
|
||
```sh | ||
make ci | ||
``` | ||
## Installation | ||
|
||
to run these checks before pushing to Github. | ||
Several tests are run on changes in CI. To replicate these tests locally, you'll | ||
need to install some tools. None are essential but they will detect possible | ||
problems before CI does. | ||
|
||
## Git commit subjects | ||
|
||
Git commit subjects must: | ||
|
||
- Be no longer than 70 characters; | ||
- Start with a capital letter; | ||
- Not end with a full stop; | ||
|
||
Further, pull request branches should rebase off `main` to incorporate upstream | ||
changes; don't merge `main` into your branch. | ||
### Prettier | ||
|
||
These rules are checked using Pytest in CI. | ||
Ensure [Prettier](https://prettier.io/) version 3.2.5 is installed. It can be installed with: | ||
|
||
## Formatting | ||
npm install -g [email protected] | ||
|
||
All markdown should be formatted with [Prettier](https://prettier.io/) version 3.0.0 | ||
This can be installed on your host OS with: | ||
Verify the installed version is correct with: | ||
|
||
npm install -g [email protected] | ||
prettier --version | ||
|
||
Once installed, ensure your editor runs Prettier on a pre-save hook: | ||
|
||
- [PyCharm instructions](https://www.jetbrains.com/help/pycharm/prettier.html) | ||
- [VSCode instructions](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) | ||
- [Vim instructions](https://prettier.io/docs/en/vim.html) | ||
|
||
Prettier conformance is checked in CI and configured via `.prettierrc.yaml` and | ||
`.prettierignore`. | ||
### Docker | ||
|
||
## Spelling | ||
Ensure you have Docker installed and [you have an account](https://www.docker.com/get-started/). | ||
Mac users can [install from Homebrew](https://formulae.brew.sh/formula/docker). | ||
|
||
Pull requests must pass a spell-check before merge. This is done using the | ||
[`tmaier/markdown-spellcheck`](https://hub.docker.com/r/tmaier/markdown-spellcheck) | ||
Docker image. | ||
### Python tooling | ||
|
||
To run the spell-test locally run: | ||
Ensure you have a Python 3.11 virtual environment created for this project and | ||
Python packages have been installed with `make install`. | ||
|
||
make spell_check | ||
There are various ways of doing this - here is one that uses `pyenv` and `pyenv-virtualenvwrapper`: | ||
|
||
or: | ||
```sh | ||
pyenv local 3.11.4 # Match the version in `.circleci/config.yml` | ||
mkvirtualenv conventions | ||
make install | ||
``` | ||
|
||
docker run --rm -ti -v $(pwd):/workdir tmaier/markdown-spellcheck:latest \ | ||
--report --ignore-numbers --ignore-acronyms "**/*.md" | ||
## Development | ||
|
||
Add exceptions to the custom dictionary in `.spelling`. | ||
### Formatting | ||
|
||
## Linting | ||
Markdown should be formatted with Prettier using the configuration in | ||
`.prettierrc.yaml`. Verify this with: | ||
|
||
Markdown files are linted by | ||
[`markdownlint-cli`](https://github.com/igorshubovych/markdownlint-cli). | ||
```sh | ||
make prettier_check | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
``` | ||
|
||
To run the linting locally run: | ||
### Linting | ||
|
||
docker run -i --rm -v `pwd`:/work tmknom/markdownlint:0.33.0 | ||
Markdown should conform to the Markdownlint rules declared in | ||
`.markdownlint.yaml`. Verify this with: | ||
|
||
or, if installed on your host OS, run: | ||
```sh | ||
make markdownlint | ||
``` | ||
|
||
markdownlint . | ||
### Spelling | ||
|
||
or: | ||
Markdown must pass a spell-check. Verify this with: | ||
|
||
make markdownlint | ||
```sh | ||
make spell_check | ||
``` | ||
|
||
Spelling exceptions are held in `.spelling`. | ||
|
||
Configuration for the enforced rules is in `.markdownlint.yaml`. | ||
### Commit messages | ||
|
||
Many linting issues can be fixed by running: | ||
Git commit subjects must: | ||
|
||
markdownlint --fix . | ||
- Be no longer than 70 characters. | ||
- Start with a capital letter. | ||
- Not end with a full stop. | ||
|
||
## Preview rendered pages | ||
Further, PR branches should rebase off `main` to incorporate upstream | ||
changes; don't merge `main` into your branch. | ||
|
||
These rules are checked using Pytest in CI. Verify conformance with: | ||
|
||
```sh | ||
make test | ||
``` | ||
|
||
### Preview rendered pages | ||
|
||
You can use [`grip`](https://github.com/joeyespo/grip) to render Github-flavour | ||
markdown files. Install with: | ||
|
||
brew install grip | ||
```sh | ||
brew install grip | ||
``` | ||
|
||
While working on docs, run a local, auto-reloading server with: | ||
|
||
make server | ||
```sh | ||
make server | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
# Run all checks run in CI. | ||
ci: test markdownlint spell_check prettier_check | ||
|
||
test: | ||
pytest -v .circleci/ | ||
|
||
markdownlint: | ||
markdownlint . | ||
docker run --rm -v $$(pwd):/work tmknom/markdownlint:0.33.0 -- . | ||
|
||
spell_check: | ||
docker run --rm -ti -v $$(pwd):/workdir tmaier/markdown-spellcheck:latest --report --ignore-numbers --ignore-acronyms "**/*.md" | ||
|
||
prettier_check: | ||
prettier --check --parser=markdown . | ||
|
||
install: | ||
pip install pytest==8.3.4 | ||
|
||
server: | ||
grip |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see
pre-save hook
in the cookie-cutter repo too but my Google-fu must be weak because I can't find this term. Is this another way of phrasing eg. Prettier running locally in your IDE when you save?