All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Fix error when formatting pattern matching syntax (#325)
- Fix error when formatting ERB (#323)
- Dropped support for Ruby 2.7 as it is end of life.
- Fix incorrect indentation methods call with splat (#320)
- Remove unused internal methods from
Rufo::Formatter
(#321)- This change may affect behavior with versions of Ruby not currently supported by Rufo (< 2.7)
- Fix Bug: Support hash literal pattern with quoted key (#312)
- Fix Bug: Unexpected EOF with blocks in .html.erb (#297)
- Fix Bug: raises error while formatting pattern matching syntax (#304)
- Fix Bug: avoid inserting a unnecessary comma to end of heredoc which in array with method call (#303)
- Formats ERB files with configuration (#275)
- Support for pattern matching syntax
- Fix Bug: raises error while formatting anonymous block argument forwarding
- Support for anonymous block argument forwarding
- Support for valueless hash literals and keyword arguments
- Support for anonymous rest and rest keyword arguments forwarding
- Correctly interpret erb scriptlets with more than one control-flow/block statement
- Dropped support for Ruby 2.6 as it is end of life.
- Support for partial argument forwarding. (#268)
- Support for endless method. (#271)
- Add Ruby 3.2.0 to test runs on CI.
- Properly format comma when a heredoc is passed as a call argument
- Correctly interpret case statements with multiple when clauses in ERB files
- Dropped support for Ruby 2.4 and 2.5 as they are end of life.
- Add Ruby 3.0.1 to test runs on CI.
- File.read default encode UTF-8
- Handle case where the code is invalid but ripper does not raise an error.
- Removed implicit dependency on
rake
. - Error when semicolon and then used in a case statement #230.
- Code coverage tracking with codecov.io
node_modules
folders are now ignored.
- Documentation for
trailing_commas
- Handle empty string symbol for key in hash.
- Support for escaped ERB template tags. For example
<%%%%= format :name %>
.
- Squiggly heredoc closing tag indentation.
- Formatting .erb files from stdin.
- Method parameters are now no longer aligned with the method parenthesis. For example:
-
def foo( param ) end # Becomes: def foo( param ) end
-
- Multiline assignments are no longer aligned with variable indentation.
-
a = if true b end # Becomes: a = if true b end
-
- Support for trim style erb templates ending with
-%>
. - Support for rails raw mode erb templates starting with
<%==
. - Support for ruby 2.7 features. This includes beginless ranges
..10
, method argument forwardingdef forward(...); to(...); end
and keyword args not being alloweddef foo(*args, **nil)
.
- Formatting a folder. For example
rufo lib
was not working.
- Documentation for
includes
andexcludes
configuration options.
- Handle endless ranges in ruby 2.6
- Handle empty string hash keys
- Output detailed description of Syntax Error to log
- Removed newlines from start of files.
- Support for rackup files
- Settings for 'quote_style' to settings.md
- Add support for ERB files
- Add Ruby 2.7.0 to test runs on CI
includes
andexcludes
configuration options
- Argument align with splat (#123)
- Support jbuilder files (#173)
- Fix bug: symbol literal like
:"foo"
in ruby 2.6.3 (#168)
- Fix odd indentation of nested one liner "if" statements (#128)
- Ignore
vendor
directories from files to be checked. This allows rufo to be run without any arguments against a directory both locally and on common CI tools without needing any configuration. - Allow logging level to be configured with
--loglevel[=LEVEL]
.
- Dropped support for ruby 2.3 as it is end of life.
- Remove space before paren for short lambda syntax
-> () {}
becomes->() {}
.
- Fix bug: Rufo crashes on nested empty hash literal (#152)
- Handle case where rufo would change formatting if run multiple times for hashes in some cases.
- Add space inside hash literal braces when contents are on the same line.
{a: 1} => { a: 1 }
. This brings Rufo inline with: - Format gem and Rake related files.
- Fix bug: Rufo indents squiggly HEREDOC incorrectly causing bad formating (#136)
- Chore: Added ruby 2.6.0 to CI test runs.
- Fix bug for double colon operator in method definition (#120)
- Fix Bug: Rufo breaks HEREDOC syntax. (#88). This fixes heredoc within parens formatting causing bad formatting and subsequent syntax error.
- Fix Bug: formatter.rb:3700:in
block in adjust_other_alignments': undefined method
[]' for nil:NilClass (NoMethodError) (#87). Check alignment target exists. - Fix Bug: Rufo keeps switching formatting on same file every time it runs (#86). Avoids re-indenting nested literal indents.
- Allow for simpler else_body node to suit new Ripper style in 2.6.0
- Allow new Ripper node :excessed_comma in block parsing
- Allow :bodystmt in lambda nodes to suit Ripper format in 2.6.0
- Drop support for ruby 2.2
- Set minimum required ruby version. As rufo is not tested on unsupported versions it may (and is known to) break code.
- Fix
quote_style
config not being respected (#95).
- Added Idempotency check to source_specs/ tester.
- Normalize string quotes according to quote_style, which defaults to :double.
- Fix printing of extraneous trailing semicolons from inline classes, modules, methods (#59)
- Fix unhandled white space between array getter/setters
x[0] [0]
(#62) - Fix comma printing for heredocs when inside a hash (#61)
- Fix array literals against changes to Ruby 2.5.0
Config parsing and handling:
- No longer using
eval
to parse config files - Warnings have been added for invalid config keys and values
The default for the following options has changed:
- parens_in_def:
:dynamic
>:yes
- trailing_commas:
:dynamic
>true
Valid options for:
- trailing_commas:
[:always, :never]
>[true, false]
The following configuration options have been removed, and replaced with non-configurable sane defaults, per discussion:
- align_assignments
- align_comments
- align_hash_keys
- indent_size
- spaces_after_comma
- spaces_after_lambda_arrow
- spaces_around_block_brace
- spaces_around_dot
- spaces_around_equal
- spaces_around_hash_arrow
- spaces_around_unary
- spaces_around_when
- spaces_in_commands
- spaces_in_suffix
- spaces_in_ternary
- spaces_inside_array_bracket
- spaces_inside_hash_brace
- visibility_indent
- double_newline_inside_type
- spaces_around_binary
- Fix crash in Ruby <= 2.3.4, <= 2.4.1 in the presence of certain squiggly doc (
<<~
) with multiple embedded expressions. The real fix here is to upgrade Ruby to >= 2.3.5 / >= 2.4.2 - Fix dedent bug and bad formatting caused by comments within chained calls (#49)
- Fix formatting bug for
for i, in [[1, 2]] ; x ; end
(#45)
Beginning of logging changes!