@prettier/plugin-ruby
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -9,2 +9,8 @@ # Changelog | ||
## [3.2.2] - 2022-09-20 | ||
### Changed | ||
- [#1276](https://github.com/prettier/plugin-ruby/pull/1276) - kddnewton - Fix the parsing for options being passed to the server process. | ||
## [3.2.1] - 2022-09-19 | ||
@@ -1265,3 +1271,4 @@ | ||
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...HEAD | ||
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...HEAD | ||
[3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2 | ||
[3.2.1]: https://github.com/prettier/plugin-ruby/compare/v3.2.0...v3.2.1 | ||
@@ -1268,0 +1275,0 @@ [3.2.0]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...v3.2.0 |
{ | ||
"name": "@prettier/plugin-ruby", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "prettier plugin for the Ruby programming language", | ||
@@ -5,0 +5,0 @@ "main": "src/plugin.js", |
@@ -62,2 +62,22 @@ const { spawn, spawnSync } = require("child_process"); | ||
// Return the list of plugins that should be passed to the server process. | ||
function getPlugins(opts) { | ||
const plugins = new Set(); | ||
const rubyPlugins = opts.rubyPlugins.trim(); | ||
if (rubyPlugins.length > 0) { | ||
rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim())); | ||
} | ||
if (opts.singleQuote) { | ||
plugins.add("plugin/single_quotes"); | ||
} | ||
if (opts.trailingComma !== "none") { | ||
plugins.add("plugin/trailing_comma"); | ||
} | ||
return Array.from(plugins); | ||
} | ||
// Create a file that will act as a communication mechanism, spawn a parser | ||
@@ -118,16 +138,5 @@ // server with that filepath as an argument, then spawn another process that | ||
const plugins = new Set(opts.rubyPlugins.split(",")); | ||
if (opts.singleQuote) { | ||
plugins.add("plugin/single_quotes"); | ||
} | ||
if (opts.trailingComma !== "none") { | ||
plugins.add("plugin/trailing_comma"); | ||
} | ||
const rubyPlugins = Array.from(plugins).join(","); | ||
const server = spawn( | ||
"ruby", | ||
[serverRbPath, `--plugins=${rubyPlugins}`, filepath], | ||
[serverRbPath, `--plugins=${getPlugins(opts).join(",")}`, filepath], | ||
{ | ||
@@ -134,0 +143,0 @@ env: Object.assign({}, process.env, { LANG: getLang() }), |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
144769
398