This repository has been archived by the owner on Dec 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
135: Support autoformatting and linting with Therapist #142
Merged
Commits on Sep 17, 2019
-
135: Full pass with
black
as first step towards autoformatting252 files reformatted, 42 files left unchanged. Done with `black --exclude node_modules .` to avoid unnecessarily reformatting third-party package helper Python in JS deps Includes migration files for consistency, even though it adds noise (209/252 files are migrations...) Tests still passing.
Steve Jalim committedSep 17, 2019 Configuration menu - View commit details
-
Copy full SHA for 39251a0 - Browse repository at this point
Copy the full SHA 39251a0View commit details -
135: add isort with black-compatible config
Created a separate .isort.cfg to make it explicit Tests passing fine after changes
Steve Jalim committedSep 17, 2019 Configuration menu - View commit details
-
Copy full SHA for b545737 - Browse repository at this point
Copy the full SHA b545737View commit details -
135: tighten up flake8 to also enforce 88-char lines, matching black
This commit contains some (manual) changes to over-long lines caught by flake8 that black _didn't_ auto-fix, because they were long strings (see psf/black#182)
Steve Jalim committedSep 17, 2019 Configuration menu - View commit details
-
Copy full SHA for 6799e72 - Browse repository at this point
Copy the full SHA 6799e72View commit details -
135: Run prettier across all SCSS, ahead of hooking it into therapist…
…'s pre-commit tasks
Steve Jalim committedSep 17, 2019 Configuration menu - View commit details
-
Copy full SHA for ca6e336 - Browse repository at this point
Copy the full SHA ca6e336View commit details -
135: Tune prettier and eslint's ignore options
Specifically: - prettier: ignore HTML, SVG, JSON and Python - eslint: ignore HTML, SVG and Python While this wouldn't be needed for editor-based formatting or linting, nor linting explicitly staged/passed files, this change is so that when we _do_ run them across the entire `developerportal` module (eg, in CI), they won't gripe about things they are not intented to be looking at anyway.
Steve Jalim committedSep 17, 2019 Configuration menu - View commit details
-
Copy full SHA for 9141a75 - Browse repository at this point
Copy the full SHA 9141a75View commit details -
135: Add Therapist to the project, running the linters and formatters…
… recently added/tweaked At this point, the assumption is you have the following installed on your host: * black * flake8 * eslint and eslint-config-prettier * isort * prettier (I'll deal with making that easier in a different commit.) Install `therapist` (https://github.com/rehandalal/therapist): $ pip install therapist Now install the pre-commit hook that will trigger Therapist automatically: $ therapist install Installing pre-commit hook... DONE Now, when you commit a change, the staged changes will be checked by one or more of black, isort, eslint and prettier, as appropriate. See `.therapist.yml` for the configuration. Alternatively, if you wanted to run it across the whole codebase (as we might well do in CI), run: $ therapist run developerportal/ black ............................................................... [SUCCESS] ESLint .............................................................. [SKIPPED] flake8 .............................................................. [SUCCESS] isort ............................................................... [SUCCESS] Prettier ............................................................ [SUCCESS] ------------------------------------------------------------------------------- Completed in: 3.67s And if you want therapist to auto-fix things using black, prettier and/or eslint, run: $ therapist run developerportal --fix
Steve Jalim committedSep 17, 2019 Configuration menu - View commit details
-
Copy full SHA for d58fdd7 - Browse repository at this point
Copy the full SHA d58fdd7View commit details -
135: Update Readme to mention how to set up and use
therapist
as a ……linter/formatter runner
Steve Jalim committedSep 17, 2019 Configuration menu - View commit details
-
Copy full SHA for f064d00 - Browse repository at this point
Copy the full SHA f064d00View commit details
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.