rufo 0.16.3 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d409deea0a4597c0cab778d78b5d055ef0efe09246063f94d4902b92967590a
4
- data.tar.gz: c49924d1209e5ae8e0387ba93596273dfca7e71ae788dc17820fecbf286f62a6
3
+ metadata.gz: 2415782555ad95778ec90751f3c438320fb1797c44213c458c0d0a7f956cf2fc
4
+ data.tar.gz: 6e2bed742d8efedef98b59b74acaef679764eeb5911e6fc0b596da1a9cec7807
5
5
  SHA512:
6
- metadata.gz: 21b4a9ce483440f4a0765b13e2ee5b2101ed9556d59ddc5714df046a773b9060d97d84c7ddfc76e9320f72cb76c5ec4ee304876c77c193108e7e29c7ab630f8e
7
- data.tar.gz: f09a85d28f35f086d980ed9d4db3d27503bb6b71ad35d8298d812464d0118f02b28ec25968ebbb822f1266254271970e3960c31cc6de0cd1b04961c7fa1fa250
6
+ metadata.gz: f103da0397ad0415a031601e14016d0080c9c22cac9d4b3af45a01f7f32a6fd851118d871d09272a8c41c7373ab8e77caac81b815899634eac66941e1f67121c
7
+ data.tar.gz: dcc1b6e6430818500a3238c1d403dd23abdfc840757318e1746bd388e0d1f4ce9a0df12a232bad5f6691dc69cd9cf6421ea1c74df8ed58c29453ac5260c91c4b
@@ -13,7 +13,7 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
  strategy:
15
15
  matrix:
16
- ruby_version: ['3.2', '3.1', '3.0', '2.7']
16
+ ruby_version: ['3.3', '3.2', '3.1', '3.0', '2.7']
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v3
data/CHANGELOG.md CHANGED
@@ -12,6 +12,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
12
12
 
13
13
  ### Added
14
14
 
15
+ ## [0.17.0] - 2024-01-06
16
+
17
+ ### Fixed
18
+
19
+ ### Changed
20
+
21
+ ### Added
22
+ - Add Ruby 3.3 to test runs on CI. ([#314](https://github.com/ruby-formatter/rufo/issues/314))
23
+ - Add `mixed` option for quote_style setting. ([#315](https://github.com/ruby-formatter/rufo/issues/315))
24
+
15
25
  ## [0.16.3] - 2023-11-09
16
26
 
17
27
  ### Fixed
@@ -1,17 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
  repos = {
4
- "rspec/rspec-core" => {
5
- "--exclude-pattern" => [
6
- "spec/rspec/core/world_spec.rb",
7
- "spec/rspec/core/formatters/exception_presenter_spec.rb",
8
- "spec/rspec/core/formatters/snippet_extractor_spec.rb",
9
- "spec/rspec/core/metadata_spec.rb",
10
- "spec/rspec/core/formatters/html_formatter_spec.rb",
11
- "spec/rspec/core/formatters_spec.rb",
12
- "spec/rspec/core/formatters/documentation_formatter_spec.rb",
13
- "spec/rspec/core/formatters/progress_formatter_spec.rb"
14
- ].join(","),
4
+ "lostisland/faraday" => {
5
+ "--format" => "progress",
15
6
  },
16
7
  }
17
8
 
data/docs/settings.md CHANGED
@@ -227,6 +227,7 @@ Use the specified quotation marks.
227
227
 
228
228
  - `:double`: (default) use doublequotations unless one or more escaped double-quotations are included
229
229
  - `:single`: use single quotations unless one or more interpolations `#{}` or escaped single quotations are included
230
+ - `:mixed`: use mixed quotations if you don't want to change quotes
230
231
 
231
232
  This does not affect `%q()` (single), `%Q()` (double), or quotation marks within heredocs.
232
233
 
@@ -278,6 +279,8 @@ code = <<CODE
278
279
  CODE
279
280
  ```
280
281
 
282
+ With `:mixed`, the formatter will keep lines as is
283
+
281
284
  ### Includes and excludes
282
285
  Files can be excluded or included in formatting with rufo by specifying glob patterns for the `includes` or `excludes` configuration options. Multiple patterns are separated by a comma.
283
286
 
@@ -636,6 +636,7 @@ class Rufo::Formatter
636
636
 
637
637
  # should we format this string according to :quote_style?
638
638
  def should_format_string?(string)
639
+ return if quote_style == :mixed
639
640
  # don't format %q or %Q
640
641
  return unless current_token_value == "'" || current_token_value == '"'
641
642
  # don't format strings containing slashes
@@ -2315,6 +2316,12 @@ class Rufo::Formatter
2315
2316
  write_indent next_indent
2316
2317
  end
2317
2318
  next_token
2319
+
2320
+ # fix for 3.3 ripper change. two :on_words_sep are generated for "#\n "
2321
+ while current_token_kind == :on_words_sep
2322
+ next_token
2323
+ end
2324
+
2318
2325
  has_space = true if current_token_value.start_with?(" ")
2319
2326
  end
2320
2327
 
@@ -2337,6 +2344,10 @@ class Rufo::Formatter
2337
2344
  next_token
2338
2345
  write_line
2339
2346
  write_indent(column)
2347
+ # two :on_words_sep are generated for "#\n " on ruby 3.3
2348
+ while current_token_kind == :on_words_sep
2349
+ next_token
2350
+ end
2340
2351
  else
2341
2352
  next_token
2342
2353
  write_space
data/lib/rufo/settings.rb CHANGED
@@ -4,7 +4,7 @@ module Rufo::Settings
4
4
  align_case_when: [false, true],
5
5
  align_chained_calls: [false, true],
6
6
  trailing_commas: [true, false],
7
- quote_style: [:double, :single],
7
+ quote_style: [:double, :single, :mixed],
8
8
  includes: nil,
9
9
  excludes: nil,
10
10
  }
data/lib/rufo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rufo
4
- VERSION = "0.16.3"
4
+ VERSION = "0.17.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.3
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ary Borenszweig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2024-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler