summary refs log tree commit diff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-10-15 15:45:13 +0100
committerGitHub <noreply@github.com>2020-10-15 15:45:13 +0100
commit654e239b25e5ed49dd0340132a74e4617aa185c8 (patch)
treebe28fe560c149a8c67688636df47729feea7459a /CONTRIBUTING.md
parentMerge branch 'master' into develop (diff)
downloadsynapse-654e239b25e5ed49dd0340132a74e4617aa185c8.tar.xz
Add option to scripts-dev/lint.sh to only lint files changed since the last git commit (#8472)
This PR makes several changes to the `./scripts-dev/lint.sh` script, which lints the codebase with a number of tools:

* Adds usage information, with `-h` flag to show it. Otherwise it will show when providing an unknown flag.
* Adds option `-d` which will check both staged and unstaged files that have changed since the last commit and add them to the list of files to lint.
  - Note that only files without an extension, or with a `.py` extension will be allowed. This prevents editing bash scripts causing the linters to break on non-python files.
* Improves the print-out of which files/directories are being linted. 
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 524f82433d..c17e3b2399 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -63,6 +63,10 @@ run-time:
 ./scripts-dev/lint.sh path/to/file1.py path/to/file2.py path/to/folder
 ```
 
+You can also provided the `-d` option, which will lint the files that have been
+changed since the last git commit. This will often be significantly faster than
+linting the whole codebase.
+
 Before pushing new changes, ensure they don't produce linting errors. Commit any
 files that were corrected.