Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
befd58f4
Commit
befd58f4
authored
5 years ago
by
Neil Pilgrim
Committed by
Andrew Morgan
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Document lint.sh & allow application to specified files only (#6312)
parent
ace947e8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CONTRIBUTING.rst
+8
-0
8 additions, 0 deletions
CONTRIBUTING.rst
changelog.d/6312.misc
+1
-0
1 addition, 0 deletions
changelog.d/6312.misc
scripts-dev/lint.sh
+11
-3
11 additions, 3 deletions
scripts-dev/lint.sh
with
20 additions
and
3 deletions
CONTRIBUTING.rst
+
8
−
0
View file @
befd58f4
...
...
@@ -58,6 +58,14 @@ All Matrix projects have a well-defined code-style - and sometimes we've even
got as far as documenting it... For instance, synapse's code style doc lives
at https://github.com/matrix-org/synapse/tree/master/docs/code_style.md.
To facilitate meeting these criteria you can run ``scripts-dev/lint.sh``
locally. Since this runs the tools listed in the above document, you'll need
python 3.6 and to install each tool. **Note that the script does not just
test/check, but also reformats code, so you may wish to ensure any new code is
committed first**. By default this script checks all files and can take some
time; if you alter only certain files, you might wish to specify paths as
arguments to reduce the run-time.
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.
...
...
This diff is collapsed.
Click to expand it.
changelog.d/6312.misc
0 → 100644
+
1
−
0
View file @
befd58f4
Document the use of `lint.sh` for code style enforcement & extend it to run on specified paths only.
This diff is collapsed.
Click to expand it.
scripts-dev/lint.sh
+
11
−
3
View file @
befd58f4
...
...
@@ -7,7 +7,15 @@
set
-e
isort
-y
-rc
synapse tests scripts-dev scripts
flake8 synapse tests
python3
-m
black synapse tests scripts-dev scripts
if
[
$#
-ge
1
]
then
files
=
$*
else
files
=
"synapse tests scripts-dev scripts"
fi
echo
"Linting these locations:
$files
"
isort
-y
-rc
$files
flake8
$files
python3
-m
black
$files
./scripts-dev/config-lint.sh
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment