Skip to content
Snippets Groups Projects
Unverified Commit 3b3d4950 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #10239 from MikeMcQuaid/rubocop-shim

rubocop: add shim and command.
parents 8ecc8b1e 62d44b5c
No related branches found
No related tags found
No related merge requests found
......@@ -183,3 +183,6 @@
# Unignore tests' bundle config
!/Library/Homebrew/test/.bundle/config
# Unignore vscode configuration
!/.vscode
{
"recommendations": [
"kaiwood.endwise",
"misogi.ruby-rubocop",
"rebornix.ruby",
"wingrunr21.vscode-ruby"
]
}
{
"ruby.rubocop.executePath": "Library/Homebrew/shims/gems/",
"files.trimTrailingWhitespace": true,
"editor.tabSize": 2,
"files.insertFinalNewline": true,
}
#: * `rubocop`
#:
#: Installs, configures and runs Homebrew's `rubocop`.
homebrew-rubocop() {
# Don't need shellcheck to follow this `source`.
# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh"
setup-ruby-path
GEM_VERSION="$("$HOMEBREW_RUBY_PATH" "$RUBY_DISABLE_OPTIONS" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
GEM_HOME="$HOMEBREW_LIBRARY/Homebrew/vendor/bundle/ruby/$GEM_VERSION"
if ! [[ -f "$GEM_HOME/bin/rubocop" ]]; then
"$HOMEBREW_BREW_FILE" install-bundler-gems
fi
export GEM_HOME
export PATH="$GEM_HOME/bin:$PATH"
# Unconditional -W0 to avoid printing e.g.:
# warning: parser/current is loading parser/ruby26, which recognizes
# warning: 2.6.6-compliant syntax, but you are running 2.6.3.
exec "$HOMEBREW_RUBY_PATH" "$RUBY_DISABLE_OPTIONS" -W0 -S rubocop "$@"
}
#!/bin/bash
exec brew rubocop "$@"
......@@ -74,6 +74,7 @@ reinstall
release-notes
remove
rm
rubocop
ruby
search
sh
......
......@@ -1206,6 +1206,10 @@ a warning will be shown if the latest minor release was less than one month ago.
* `--markdown`:
Print as a Markdown list.
### `rubocop`
Installs, configures and runs Homebrew's `rubocop`.
### `ruby` (`-e` *`text`*|*`file`*)
Run a Ruby instance with Homebrew's libraries loaded, e.g.
......
......@@ -1683,6 +1683,9 @@ If \fB\-\-markdown\fR and a \fIprevious_tag\fR are passed, an extra line contain
\fB\-\-markdown\fR
Print as a Markdown list\.
.
.SS "\fBrubocop\fR"
Installs, configures and runs Homebrew\'s \fBrubocop\fR\.
.
.SS "\fBruby\fR (\fB\-e\fR \fItext\fR|\fIfile\fR)"
Run a Ruby instance with Homebrew\'s libraries loaded, e\.g\. \fBbrew ruby \-e "puts :gcc\.f\.deps"\fR or \fBbrew ruby script\.rb\fR\.
.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment