Fredrik Ekre
fcb3d9ff5a
Implement `# runic: (off|on)` toggle comments
...
This patch implements `# runic: on` and `# runic: off` toggle comments
that can be included in the source to toggle formatting on/off.
The two comments i) must be placed on their own lines, ii) must be on
the same level in the expression tree, and iii) must come in pairs. An
exception to condition iii) is made for top level toggle comments so
that formatting for a whole file can be disabled by a `# runic: off`
comment at the top without having to add one also at the end of the
file.
For compatibility with JuliaFormatter, `#! format: (on|off)` is also
supported but it is not possible to pair e.g. a `# runic: off` comment
with a `#! format: on` comment.
Closes #12 , closes #41 .
1 year ago
Fredrik Ekre
2c455a07fd
Update README after --help changes
1 year ago
Fredrik Ekre
73ab2ae547
Add some more information to the readme.
1 year ago
Fredrik Ekre
4bee1e0f94
Remove the octal formatting
...
Octal formatting isn't as useful as hex formatting and it is also value
dependent (not just string-length dependent) which makes it a bit odd.
Octals are also very rare. One of the more common ones are filemodes and
for that case e.g. 0o755 looks better than 0o000755. Closes #40 .
1 year ago
Fredrik Ekre
fa78ba6948
Add instructions for VS Code integration
1 year ago
Fredrik Ekre
a41bc5dd81
Fix trailing semicolon in parens-block
...
This patch make sure to keep the trailing semicolon in parens-block if
there is just a single item. Without the trailing colon the text would
be parsed as parens but not as a block (compare `(1)` vs `(1,)` for
tuples). Closes #38 .
1 year ago
Fredrik Ekre
9edf7d72cd
main: fix printing in check mode
1 year ago
Fredrik Ekre
4a13a3fc4a
Rework command line argument parsing, closes #36 .
1 year ago
Fredrik Ekre
bce2590aae
Remove TODO list since everything is converted to issues
1 year ago
Fredrik Ekre
3ee9531e4d
Fix function indent with unusual infix definitions
1 year ago
Fredrik Ekre
f0a6d32476
Fix handling of comments within import/using lists
1 year ago
Kristoffer
e697677cc2
Fix a few JET opt errors, closes #31 .
1 year ago
Fredrik Ekre
bf9e3b0409
Skip trailing comma in list after macrocall items
...
Fixes #32 .
1 year ago
Fredrik Ekre
d82a8795d9
Add is_triple_string utility function
1 year ago
Fredrik Ekre
d239be296e
Smoke test /base and /test from JuliaLang/julia
1 year ago
Fredrik Ekre
347490760a
Fix formatting of multiline triple strings with \-escaped newlines
...
Closes #29 .
1 year ago
Kristoffer Carlsson
21265f7500
avoid variables captured in closure from becoming boxed by passing them in as arguments. ( #30 )
1 year ago
Fredrik Ekre
02f0457782
Use xargs instead of mapfile for CI/git hook examples
1 year ago
Fredrik Ekre
ad5fe4d065
Fix multiline string recursion with triple strings on one line
1 year ago
Fredrik Ekre
aeabe11718
Indent: recurse into multiline strings, closes #27
1 year ago
Fredrik Ekre
7ab66e5fd1
Fix continuation-indent in cartesian iterator heads
1 year ago
Fredrik Ekre
836d498c2d
Multiline list classification: recurse into multiline triple strings
1 year ago
Fredrik Ekre
4d2c0fd041
Fix list spacing in K"braces" with K"parameters"
1 year ago
Fredrik Ekre
ba6522aced
Fix indent of multiline vcat with trailing whitespace
1 year ago
Fredrik Ekre
c76c60801f
Fix formatting of mixed generator/cartesian nodes
1 year ago
Fredrik Ekre
8e7af2db10
Fix (unnecessary) parenthesized symbols in export/public
1 year ago
Fredrik Ekre
0fdfc27c83
Fix formatting of K"parameters" inside K"ref"
1 year ago
Fredrik Ekre
49e6c9dc53
Fix handling of inline comments in export/public expressions
1 year ago
Fredrik Ekre
c19f5b578e
Fix import/using lists with operators and macros
1 year ago
Hugo LEVY-FALK
53260886fd
Add a test for empty file list in git hook suggestion ( #26 )
...
As it was, the proposed git hook will fail if no Julia file has been
edited in the commit (for example if we only edited Project.toml).
1 year ago
Fredrik Ekre
88e6560700
Fix indent of long form functor definitions
1 year ago
Fredrik Ekre
b87b3cde1b
Fix import renaming of macros
1 year ago
Fredrik Ekre
d156504692
Fix interpolated vars as `as`-aliases
1 year ago
Fredrik Ekre
e57859e267
Allow interpolated vars in export lists inside macrocalls
1 year ago
Fredrik Ekre
bbc144d143
Fix var-nodes in export/public lists
1 year ago
Fredrik Ekre
9043278d44
Fix non-K"Identifier" leafs in export lists
1 year ago
Fredrik Ekre
2a9843fc99
Fix export/public expressions with comments
1 year ago
Fredrik Ekre
6d975d35a3
Fix parenthesized macrocalls with keyword arguments
1 year ago
Fredrik Ekre
d8efd2f05d
Fix formatting of import/using with `as` renaming
1 year ago
Fredrik Ekre
3645072700
Fix bug in formatting of export/public expressions with interpolated vars
1 year ago
Fredrik Ekre
948f2d30ac
Fix module indent with parenthesized module name
1 year ago
Fredrik Ekre
0660870c08
Fix bug in formatting in export/public expressions with macronames
1 year ago
Fredrik Ekre
d65bf57ae0
Format spaces in export/public expressions, fixes #25
1 year ago
Fredrik Ekre
3f9b692167
Format spaces in using/import expressions, fixes #25
1 year ago
Fredrik Ekre
8904edd2a4
Refine installation and editor integration docs ( #23 )
1 year ago
Kristoffer Carlsson
ebc2ba5917
parse with latest 1.x compatible syntax ( #24 )
1 year ago
Fredrik Ekre
025ad41c76
Default output to stdout if input is stdin
1 year ago
Fredrik Ekre
0e214b6c69
Remove leading whitespace in the beginning of a file
...
This is needed to "bootstrap" the indent process since there isn't a
leading newline to indent to level 0 when there is leading whitespace.
1 year ago
Fredrik Ekre
e7229cb65e
Add section on editor integration
1 year ago
Fredrik Ekre
1184d2ba43
Fix indent of array comprehensions, fixes #20
1 year ago