Repository navigation
Commit ce527c7
committed
Rewrite the code formatter, implement multiple requested features,
address bugs
This is a rewrite of the code formatter that changes the architecture,
removes dependencies, and makes it more robust and powerful.
In short, this:
- Implements requested features including automated line wrapping or
editorconfig support
- Addresses several known issues
- Gets rid of multiple dependencies
- Improves performance by an order of magnitude. Speedups range from 10x
to over 50x depending on the case
Because this implements automated line wrapping this changes the
formatter's behavior.
Features and tasks:
Close #145: Remove all unwraps from project and follow stricter linting
rules
Close #250: Rewrite the formatter to make it more robust
Close #220: Refactor post-processing to use a visitor pattern + AST
edits instead of regex
Close #249: Allow configuring number of lines between functions
Close #244: Add editorconfig support
Close #151: Add an option to preserve leading indentation within code
blocks
Part of #181: Godot addon: Add a way to have shared settings across a
team
Bug fixes:
Fix #235: Formatter issue related to extra space in front of class_name
Fix #245: Wrong @annotation formatting inside an inner class
Fix #242: --reorder-code detaches per-function @warning_ignore(...) from
its function in scripts without a class_name/extends header
Fix #247: Wrong region order in the inner class
Fix #225: lint loop-variable-name for unused vars
Fix #190: If statement and comment line get dedented in this nested code
block
Fix #207: In some situations formatting with vs without --reorder-code
is not indempotent
Fix #189: Command 'Unistall Formatter' doesn't exists.
Fix #248: Installing the binary formatter on mac m1 with arm installs
wrong x861 parent 44dd067 commit ce527c7
193 files changed
Lines changed: 7838 additions & 4771 deletions
File tree
- .github/workflows
- addons/GDQuest_GDScript_formatter
- config
- docs
- images
- queries
- src
- bin
- linter
- rules
- tests
- expected
- input
- lint
- expected
- input
- reorder_code/expected
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
5 | 37 | | |
6 | 38 | | |
7 | 39 | | |
| |||
0 commit comments