Skip to content

Commit

Permalink
Clean up templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed Jun 23, 2021
1 parent 71911cf commit 322d5e8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
18 changes: 11 additions & 7 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ about: Issues with prettier crashing

## Metadata

- Ruby version: ...
- `@prettier/plugin-ruby` or `prettier` gem version: ...
- Operating system: Ubuntu
- Ruby version: latest
- Node version: latest
- `@prettier/plugin-ruby` or `prettier` gem version: latest
- Options:
- [x] `rubyHashLabel`
- [x] `rubyModifier`
- [x] `rubySingleQuote`
- [ ] `rubyToProc`
- [ ] `trailingComma`
- `rubyArrayLiteral` - `true`
- `rubyHashLabel` - `true`
- `rubyModifier` - `true`
- `rubyNetcatCommand` - `null`
- `rubySingleQuote` - `true`
- `rubyToProc` - `false`
- `trailingComma` - `"none"`

## Input

Expand Down
18 changes: 11 additions & 7 deletions .github/ISSUE_TEMPLATE/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ about: Issues for ugly or incorrect code

## Metadata

- Ruby version: ...
- `@prettier/plugin-ruby` or `prettier` gem version: ...
- Operating system: Ubuntu
- Ruby version: latest
- Node version: latest
- `@prettier/plugin-ruby` or `prettier` gem version: latest
- Options:
- [x] `rubyHashLabel`
- [x] `rubyModifier`
- [x] `rubySingleQuote`
- [ ] `rubyToProc`
- [ ] `trailingComma`
- `rubyArrayLiteral` - `true`
- `rubyHashLabel` - `true`
- `rubyModifier` - `true`
- `rubyNetcatCommand` - `null`
- `rubySingleQuote` - `true`
- `rubyToProc` - `false`
- `trailingComma` - `"none"`

## Input

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@ The `prettier` executable is now installed and ready for use:

Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports:

| API Option | CLI Option | Default | Description |
| ------------------- | ----------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). |
| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). |
| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. |
| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. |
| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. |
| `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. |
| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. |
| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. |
| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). |
| `trailingComma` | `--trailing-comma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. |
| API Option | CLI Option | Default | Description |
| ------------------- | ----------------------- | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). |
| `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). |
| `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. |
| `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. |
| `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. |
| `rubyNetcatCommand` | `--ruby-netcat-command` | | The prefix of the command to execute to communicate between the node.js process and the Ruby process. (For example, `"nc -U"` or `"telnet -u"`) Normally you should not set this option. |
| `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. |
| `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. |
| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). |
| `trailingComma` | `--trailing-comma` | `"none"` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. |

Any of these can be added to your existing [prettier configuration
file](https://prettier.io/docs/en/configuration.html). For example:
Expand Down

0 comments on commit 322d5e8

Please sign in to comment.