-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1434 from koic/pluginfy_with_lint_roller
Pluginfy RuboCop Rails
- Loading branch information
Showing
13 changed files
with
56 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#1434](https://github.com/rubocop/rubocop-rails/pull/1434): Pluginfy RuboCop Rails. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module RuboCop | ||
# RuboCop Rails project namespace | ||
# RuboCop Rails project namespace. | ||
module Rails | ||
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze | ||
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze | ||
|
||
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT) | ||
|
||
::RuboCop::ConfigObsoletion.files << PROJECT_ROOT.join('config', 'obsoletion.yml') | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'lint_roller' | ||
|
||
module RuboCop | ||
module Rails | ||
# A plugin that integrates RuboCop Rails with RuboCop's plugin system. | ||
class Plugin < LintRoller::Plugin | ||
def about | ||
LintRoller::About.new( | ||
name: 'rubocop-rails', | ||
version: Version::STRING, | ||
homepage: 'https://github.com/rubocop/rubocop-rails', | ||
description: 'A RuboCop extension focused on enforcing Rails best practices and coding conventions.' | ||
) | ||
end | ||
|
||
def supported?(context) | ||
context.engine == :rubocop | ||
end | ||
|
||
def rules(_context) | ||
project_root = Pathname.new(__dir__).join('../../..') | ||
|
||
ConfigObsoletion.files << project_root.join('config', 'obsoletion.yml') | ||
|
||
LintRoller::Rules.new(type: :path, config_format: :rubocop, value: project_root.join('config', 'default.yml')) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters