From 67a65918ad7723400f25339ef3f4447e7b3dc1b6 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Fri, 1 Nov 2019 16:45:09 +0200 Subject: [PATCH] Add contributer docs for using the provided linters script (#6164) * Add lint dependencies black, flake8 and isort These are required when running the `lint.sh` dev scripts. Signed-off-by: Jason Robinson * Add contributer docs for using the providers linters script Add also to the pull request template to avoid build failures due to people not knowing that linters need running. Signed-off-by: Jason Robinson * Fix mention of linter errors correction Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Add mention for installing linter dependencies Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Remove linters from python dependencies as per PR review Signed-off-by: Jason Robinson --- .github/PULL_REQUEST_TEMPLATE.md | 1 + CONTRIBUTING.rst | 11 +++++++++++ changelog.d/6164.doc | 1 + 3 files changed, 13 insertions(+) create mode 100644 changelog.d/6164.doc diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1ead0d0030..8939fda67d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,3 +5,4 @@ * [ ] Pull request is based on the develop branch * [ ] Pull request includes a [changelog file](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst#changelog) * [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst#sign-off) +* [ ] Code style is correct (run the [linters](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst#code-style)) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 2fb3a95949..df81f6e54f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -70,6 +70,17 @@ Please ensure your changes match the cosmetic style of the existing project, and **never** mix cosmetic and functional changes in the same commit, as it makes it horribly hard to review otherwise. +Before doing a commit, ensure the changes you've made don't produce +linting errors. You can do this by running the linters as follows. Ensure to +commit any files that were corrected. + +:: + # Install the dependencies + pip install -U black flake8 isort + + # Run the linter script + ./scripts-dev/lint.sh + Changelog ~~~~~~~~~ diff --git a/changelog.d/6164.doc b/changelog.d/6164.doc new file mode 100644 index 0000000000..f9395b02b3 --- /dev/null +++ b/changelog.d/6164.doc @@ -0,0 +1 @@ +Contributor documentation now mentions script to run linters.