prettier 3.2.1 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32366c0f21ecd68aa457ffa258101c877877a7154f3603eb2f26c7d51865937f
4
- data.tar.gz: 06f87e22a36daf12111981b031a63d120c50ec24c30be2056f73b96d2b4a4e96
3
+ metadata.gz: 5c772ae9c41714e30e74b8d7d832a2efdd939835ada857eeb4ec80e1f036d4d5
4
+ data.tar.gz: f9895d25d44b055627a3518d13b3c81334bcc9bb13514a8617f3ad49ef0b8114
5
5
  SHA512:
6
- metadata.gz: ccede4bd64194b7ca7de7b08e9957b78635813cacdad577b1a2c9e0041cde2281ef6175175d3c100086fe2895394437828cb52e79ac9ca534c32c486ca400935
7
- data.tar.gz: 5b54c65167a99225f69569e3537e7a74d800ef675bc9b2a5c2eca69f126d937ba7c80b1909c7dfc68c1027d6537db765496810aa8b594b1686cb2409a34ad7d8
6
+ metadata.gz: 9a131aed0b99f4ea445a64c6c9c985931523ad6f5586df6e5d08d263d0ab4f1c40f4a17c685590b726afcae498ece6b34cf2fe9451a8e24bdc22ff8896719ea8
7
+ data.tar.gz: d3723afae5fdf5547e1f88f2d3443964951fe2faa8931434afa01aa8565643f93282b28bb15064079447022497234b7c28bd1eae0b78c5b6985053f4f498291e
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.2.2] - 2022-09-20
10
+
11
+ ### Changed
12
+
13
+ - [#1276](https://github.com/prettier/plugin-ruby/pull/1276) - kddnewton - Fix the parsing for options being passed to the server process.
14
+
9
15
  ## [3.2.1] - 2022-09-19
10
16
 
11
17
  ### Changed
@@ -1261,7 +1267,8 @@ would previously result in `array[]`, but now prints properly.
1261
1267
 
1262
1268
  - Initial release 🎉
1263
1269
 
1264
- [unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...HEAD
1270
+ [unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...HEAD
1271
+ [3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2
1265
1272
  [3.2.1]: https://github.com/prettier/plugin-ruby/compare/v3.2.0...v3.2.1
1266
1273
  [3.2.0]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...v3.2.0
1267
1274
  [3.1.2]: https://github.com/prettier/plugin-ruby/compare/v3.1.1...v3.1.2
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prettier/plugin-ruby",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "prettier plugin for the Ruby programming language",
5
5
  "main": "src/plugin.js",
6
6
  "scripts": {
data/src/parseSync.js CHANGED
@@ -59,6 +59,26 @@ function getInfoFilepath() {
59
59
  return path.join(os.tmpdir(), `prettier-ruby-parser-${process.pid}.info`);
60
60
  }
61
61
 
62
+ // Return the list of plugins that should be passed to the server process.
63
+ function getPlugins(opts) {
64
+ const plugins = new Set();
65
+
66
+ const rubyPlugins = opts.rubyPlugins.trim();
67
+ if (rubyPlugins.length > 0) {
68
+ rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim()));
69
+ }
70
+
71
+ if (opts.singleQuote) {
72
+ plugins.add("plugin/single_quotes");
73
+ }
74
+
75
+ if (opts.trailingComma !== "none") {
76
+ plugins.add("plugin/trailing_comma");
77
+ }
78
+
79
+ return Array.from(plugins);
80
+ }
81
+
62
82
  // Create a file that will act as a communication mechanism, spawn a parser
63
83
  // server with that filepath as an argument, then spawn another process that
64
84
  // will read that information in order to enable us to connect to it in the
@@ -114,20 +134,9 @@ function spawnServer(opts) {
114
134
  };
115
135
  }
116
136
 
117
- const plugins = new Set(opts.rubyPlugins.split(","));
118
- if (opts.singleQuote) {
119
- plugins.add("plugin/single_quotes");
120
- }
121
-
122
- if (opts.trailingComma !== "none") {
123
- plugins.add("plugin/trailing_comma");
124
- }
125
-
126
- const rubyPlugins = Array.from(plugins).join(",");
127
-
128
137
  const server = spawn(
129
138
  "ruby",
130
- [serverRbPath, `--plugins=${rubyPlugins}`, filepath],
139
+ [serverRbPath, `--plugins=${getPlugins(opts).join(",")}`, filepath],
131
140
  {
132
141
  env: Object.assign({}, process.env, { LANG: getLang() }),
133
142
  detached: true,
data/src/server.rb CHANGED
@@ -129,7 +129,9 @@ listener =
129
129
  PrettierPrint
130
130
  end
131
131
 
132
- formatter = formatter_class.new(+"", maxwidth, "\n", &genspace)
132
+ formatter =
133
+ formatter_class.new(source, +"", maxwidth, "\n", &genspace)
134
+
133
135
  SyntaxTree::Haml.parse(source).format(formatter)
134
136
  formatter.flush
135
137
  formatter.output
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prettier
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Newton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-19 00:00:00.000000000 Z
11
+ date: 2022-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: syntax_tree