@prettier/plugin-ruby
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -6,2 +6,7 @@ --- | ||
## Metadata | ||
* Ruby version: ... | ||
* @prettier/plugin-ruby version: ... | ||
## Input | ||
@@ -8,0 +13,0 @@ |
@@ -9,2 +9,7 @@ # Changelog | ||
## [0.6.1] - 2019-02-15 | ||
### Changed | ||
- Fix Ruby 2.5 inline comments on `args_add_block` nodes. (Thanks to @meleyal for the report.) | ||
- Support passing `super()` explicitly with no arguments. (Thanks to @meleyal for the report.) | ||
## [0.6.0] - 2019-02-14 | ||
@@ -147,3 +152,4 @@ ### Added | ||
[Unreleased]: https://github.com/CultureHQ/add-to-calendar/compare/v0.6.0...HEAD | ||
[Unreleased]: https://github.com/CultureHQ/add-to-calendar/compare/v0.6.1...HEAD | ||
[0.6.1]: https://github.com/CultureHQ/add-to-calendar/compare/v0.6.0...v0.6.1 | ||
[0.6.0]: https://github.com/CultureHQ/add-to-calendar/compare/v0.5.2...v0.6.0 | ||
@@ -150,0 +156,0 @@ [0.5.2]: https://github.com/CultureHQ/add-to-calendar/compare/v0.5.1...v0.5.2 |
{ | ||
"name": "@prettier/plugin-ruby", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "prettier plugin for the Ruby programming language", | ||
@@ -5,0 +5,0 @@ "main": "src/ruby.js", |
@@ -75,5 +75,5 @@ <div align="center"> | ||
* [`ruby`](https://www.ruby-lang.org/en/documentation/installation/) `2.5` or newer - there are a lot of ways to install `ruby`, but I recommend [`rbenv`](https://github.com/rbenv/rbenv) | ||
* [`node`](https://nodejs.org/en/download/) `8.3` or newer - `prettier` is a JavaScript package, so you're going to need to install `node` to work with it | ||
* [`npm`](https://www.npmjs.com/get-npm) or [`yarn`](https://yarnpkg.com/en/docs/getting-started) - these are package managers for JavaScript, either one will do | ||
- [`ruby`](https://www.ruby-lang.org/en/documentation/installation/) `2.5` or newer - there are a lot of ways to install `ruby`, but I recommend [`rbenv`](https://github.com/rbenv/rbenv) | ||
- [`node`](https://nodejs.org/en/download/) `8.3` or newer - `prettier` is a JavaScript package, so you're going to need to install `node` to work with it | ||
- [`npm`](https://www.npmjs.com/get-npm) or [`yarn`](https://yarnpkg.com/en/docs/getting-started) - these are package managers for JavaScript, either one will do | ||
@@ -95,3 +95,3 @@ Second, you're going to need to list `@prettier/plugin-ruby` as a JavaScript dependency from within whatever project on which you're working. | ||
```bash | ||
./node_modules/.bin/prettier --write --plugin=@prettier/plugin-ruby path/to/file.rb | ||
./node_modules/.bin/prettier --write path/to/file.rb | ||
``` | ||
@@ -102,3 +102,3 @@ | ||
```bash | ||
./node_modules/.bin/prettier --write --plugin=@prettier/plugin-ruby '**/*.{rb,rake}' | ||
./node_modules/.bin/prettier --write '**/*.{rb,rake}' | ||
``` | ||
@@ -112,11 +112,11 @@ | ||
| Name | Default | Description | | ||
|------|:-------:|-------------| | ||
| `printWidth` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | | ||
| `tabWidth` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | | ||
| `addTrailingCommas` | `false` | Adds a trailing comma to array literals, hash literals, and method calls. | | ||
| `inlineConditionals` | `true` | When it fits on one line, allows if and unless statements to use the modifier form. | | ||
| `inlineLoops` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | | ||
| `preferHashLabels` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | | ||
| `preferSingleQuotes` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | | ||
| Name | Default | Description | | ||
| -------------------- | :-----: | ------------------------------------------------------------------------------------------------------------- | | ||
| `printWidth` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | | ||
| `tabWidth` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | | ||
| `addTrailingCommas` | `false` | Adds a trailing comma to array literals, hash literals, and method calls. | | ||
| `inlineConditionals` | `true` | When it fits on one line, allows if and unless statements to use the modifier form. | | ||
| `inlineLoops` | `true` | When it fits on one line, allows while and until statements to use the modifier form. | | ||
| `preferHashLabels` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. | | ||
| `preferSingleQuotes` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. | | ||
@@ -129,4 +129,4 @@ ## Development | ||
* https://github.com/ruby/ruby/blob/trunk/parse.y - the Ruby parser that will give you the names of the nodes as well as their structure | ||
* https://github.com/ruby/ruby/blob/trunk/test/ripper/test_parser_events.rb - the test file that gives you code examples of each kind of node | ||
- https://github.com/ruby/ruby/blob/trunk/parse.y - the Ruby parser that will give you the names of the nodes as well as their structure | ||
- https://github.com/ruby/ruby/blob/trunk/test/ripper/test_parser_events.rb - the test file that gives you code examples of each kind of node | ||
@@ -133,0 +133,0 @@ ## Contributing |
@@ -552,3 +552,12 @@ const { align, breakParent, concat, dedent, dedentToRoot, group, hardline, ifBreak, indent, join, line, lineSuffix, literalline, markAsRoot, softline, trim } = require("prettier").doc.builders; | ||
super: (path, opts, print) => { | ||
if (path.getValue().body[0].type === "arg_paren") { | ||
const args = path.getValue().body[0]; | ||
if (args.type === "arg_paren") { | ||
// In case there are explicitly no arguments but they are using parens, | ||
// we assume they are attempting to override the initializer and pass no | ||
// arguments up. | ||
if (args.body[0] === null) { | ||
return "super()"; | ||
} | ||
return concat(["super", path.call(print, "body", 0)]); | ||
@@ -555,0 +564,0 @@ } |
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
181766
1179