-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prettier for non-python formatting
Adding prettier for consistent formatting of non-python files. Ruff format only applies to python files, however, other files in the repo still have similar concerns (consistency, whitespace thrashing, etc). Prettier addresses this concern in the same way as ruff; minimal configurability to prevent bikeshedding. All non-conformant files have been formatted to pass the pre-commit hook. Very few changes were needed; several yaml files were modified to have consistent whitespace and indentation, including the pre-commit configuration file. Modern text editors and IDEs (efficiently) support prettier via plugin; this is recommended for local formatting. A cli tool is available, however, prettier itself is written in javascript so it is only accessible via npm/yarn (`npx prettier`/`yarn dlx prettier`). While this is unfortunate, there are very few tools that format general source files, and none within the python ecosystem. Pre-commit does address this capability gap indirectly. It can be run via `pre-commit run prettier`, either with the `--all-files` flag or by adding a modified file to your working tree. While suboptimal, this does allow local formatting/validation if needed.
- Loading branch information
Showing
7 changed files
with
139 additions
and
109 deletions.
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
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,16 @@ | ||
# macOS resource forks | ||
._* | ||
.DS_Store | ||
|
||
# Build artifacts | ||
/build | ||
/dist | ||
|
||
# Generated environments | ||
/venv | ||
|
||
# Cache files | ||
/.hypothesis | ||
/.mypy_cache | ||
/.pytest_cache | ||
/.ruff_cache |
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,4 @@ | ||
trailingComma = "none" | ||
tabWidth = 2 | ||
semi = false | ||
printWidth = 100 |
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