@prettier/plugin-ruby
Advanced tools
Comparing version 0.19.0 to 0.19.1
@@ -9,2 +9,11 @@ # Changelog | ||
## [0.19.1] - 2020-08-21 | ||
### Changed | ||
- [@Rsullivan00] - Do not tranform word-literal arrays when there is an escape sequence. | ||
- [@steobrien], [@kddeisz] - Do not indent heredocs with calls more than they should be. | ||
- [@jpickwell] - Include .simplecov in filenames | ||
- [@github0013], [@kddeisz] - Ensure we're parsing ruby files using UTF-8 regardless of the system encoding. | ||
## [0.19.0] - 2020-07-03 | ||
@@ -814,3 +823,4 @@ | ||
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v0.19.0...HEAD | ||
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v0.19.1...HEAD | ||
[0.19.1]: https://github.com/prettier/plugin-ruby/compare/v0.19.0...v0.19.1 | ||
[0.19.0]: https://github.com/prettier/plugin-ruby/compare/v0.18.2...v0.19.0 | ||
@@ -909,1 +919,3 @@ [0.18.2]: https://github.com/prettier/plugin-ruby/compare/v0.18.1...v0.18.2 | ||
[@yuki24]: https://github.com/yuki24 | ||
[@rsullivan00]: https://github.com/Rsullivan00 | ||
[@steobrien]: https://github.com/steobrien |
{ | ||
"name": "@prettier/plugin-ruby", | ||
"version": "0.19.0", | ||
"version": "0.19.1", | ||
"description": "prettier plugin for the Ruby programming language", | ||
@@ -30,3 +30,3 @@ "main": "src/ruby.js", | ||
"jest": "^26.0.0", | ||
"pretty-quick": "^2.0.1" | ||
"pretty-quick": "^3.0.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "eslintConfig": { |
@@ -220,2 +220,5 @@ <div align="center"> | ||
<td align="center"><a href="https://www.locksteplabs.com/"><img src="https://avatars1.githubusercontent.com/u/7811733?v=4" width="100px;" alt=""/><br /><sub><b>Jan Klimo</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=janklimo" title="Code">π»</a></td> | ||
<td align="center"><a href="http://ricksullivan.net"><img src="https://avatars0.githubusercontent.com/u/3654176?v=4" width="100px;" alt=""/><br /><sub><b>Rick Sullivan</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3ARsullivan00" title="Bug reports">π</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=Rsullivan00" title="Code">π»</a></td> | ||
<td align="center"><a href="https://twitter.com/steobrien"><img src="https://avatars3.githubusercontent.com/u/1694410?v=4" width="100px;" alt=""/><br /><sub><b>Stephen O'Brien</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Asteobrien" title="Bug reports">π</a></td> | ||
<td align="center"><a href="https://github.com/nimish-mehta"><img src="https://avatars2.githubusercontent.com/u/2488470?v=4" width="100px;" alt=""/><br /><sub><b>Nimish Mehta</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Animish-mehta" title="Bug reports">π</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=nimish-mehta" title="Code">π»</a></td> | ||
</tr> | ||
@@ -222,0 +225,0 @@ </table> |
@@ -12,2 +12,4 @@ const { | ||
const preserveArraySubstrings = [" ", "\\"]; | ||
const isStringArray = (args) => | ||
@@ -19,3 +21,5 @@ args.body.every( | ||
arg.body[0].body[0].type === "@tstring_content" && | ||
!arg.body[0].body[0].body.includes(" ") | ||
!preserveArraySubstrings.some((str) => | ||
arg.body[0].body[0].body.includes(str) | ||
) | ||
); | ||
@@ -22,0 +26,0 @@ |
@@ -1,2 +0,2 @@ | ||
const { concat, group, indent, hardline, softline } = require("../prettier"); | ||
const { concat, group, indent, literalline, softline } = require("../prettier"); | ||
const toProc = require("../toProc"); | ||
@@ -45,3 +45,3 @@ const { concatBody, first, makeCall } = require("../utils"); | ||
printedMessage, | ||
hardline, | ||
literalline, | ||
concat(path.map.apply(path, [print].concat(heredoc.content))), | ||
@@ -48,0 +48,0 @@ heredoc.ending |
const { spawnSync } = require("child_process"); | ||
const path = require("path"); | ||
// In order to properly parse ruby code, we need to tell the ruby process to | ||
// parse using UTF-8. Unfortunately, the way that you accomplish this looks | ||
// differently depending on your platform. This object below represents all of | ||
// the possible values of process.platform per: | ||
// https://nodejs.org/api/process.html#process_process_platform | ||
const LANG = { | ||
aix: "C.UTF-8", | ||
darwin: "en_US.UTF-8", | ||
freebsd: "C.UTF-8", | ||
linux: "C.UTF-8", | ||
openbsd: "C.UTF-8", | ||
sunos: "C.UTF-8", | ||
win32: ".UTF-8" | ||
}[process.platform]; | ||
module.exports = (text, _parsers, _opts) => { | ||
@@ -9,2 +24,3 @@ const child = spawnSync( | ||
{ | ||
env: { LANG }, | ||
input: text, | ||
@@ -11,0 +27,0 @@ maxBuffer: 10 * 1024 * 1024 // 10MB |
@@ -52,2 +52,3 @@ const parse = require("./parse"); | ||
".pryrc", | ||
".simplecov", | ||
"Appraisals", | ||
@@ -54,0 +55,0 @@ "Berksfile", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2772
256
242638
66