generated from r7kamura/rubocop-extension-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recommend usage of
require: rubocop-rails-accessibility
; rename Rub…
…oCop department to "RailsAccessibility"
- Loading branch information
1 parent
61e9f3e
commit 6199ad2
Showing
21 changed files
with
95 additions
and
77 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 |
---|---|---|
@@ -1,15 +1,11 @@ | ||
require: | ||
- rubocop/cop/rubocop_rails_accessibility_cops | ||
|
||
AllCops: | ||
DisabledByDefault: true | ||
|
||
RubocopRailsAccessibility/ImageHasAlt: | ||
RailsAccessibility/ImageHasAlt: | ||
Enabled: true | ||
StyleGuide: https://github.com/github/rubocop-rails-accessibility/blob/master/guides/image-has-alt.md | ||
RubocopRailsAccessibility/NoPositiveTabindex: | ||
|
||
RailsAccessibility/NoPositiveTabindex: | ||
Enabled: true | ||
StyleGuide: https://github.com/github/rubocop-rails-accessibility/blob/master/guides/no-positive-tabindex.md | ||
RubocopRailsAccessibility/NoRedundantImageAlt: | ||
|
||
RailsAccessibility/NoRedundantImageAlt: | ||
Enabled: true | ||
StyleGuide: https://github.com/github/rubocop-rails-accessibility/blob/master/guides/no-redundant-image-alt.md |
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,12 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rubocop" | ||
require "rubocop/rails_accessibility" | ||
require "rubocop/rails_accessibility/inject" | ||
require "rubocop/rails_accessibility/version" | ||
|
||
RuboCop::RailsAccessibility::Inject.defaults! | ||
|
||
require "rubocop/cop/rails_accessibility/image_has_alt" | ||
require "rubocop/cop/rails_accessibility/no_positive_tabindex" | ||
require "rubocop/cop/rails_accessibility/no_redundant_image_alt" |
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
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 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,10 @@ | ||
# frozen_string_literal: true | ||
|
||
require "pathname" | ||
|
||
module RuboCop | ||
module RailsAccessibility | ||
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze | ||
CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rubocop" | ||
|
||
# The original code is from https://github.com/rubocop/rubocop-rspec/blob/main/lib/rubocop/rspec/inject.rb | ||
# See https://github.com/rubocop/rubocop-rspec/blob/main/MIT-LICENSE.md | ||
module RuboCop | ||
module RailsAccessibility | ||
module Inject | ||
def self.defaults! | ||
path = CONFIG_DEFAULT.to_s | ||
hash = ::RuboCop::ConfigLoader.send(:load_yaml_configuration, path) | ||
config = ::RuboCop::Config.new(hash, path).tap(&:make_excludes_absolute) | ||
puts "configuration from #{path}" if ::RuboCop::ConfigLoader.debug? | ||
config = ::RuboCop::ConfigLoader.merge_with_default(config, path) | ||
::RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, config) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module RuboCop | ||
module RailsAccessibility | ||
VERSION = "0.1.2" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "lib/rubocop/cop/version" | ||
require_relative "lib/rubocop/rails_accessibility/version" | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "rubocop-rails-accessibility" | ||
spec.version = RubocopRailsAccessibility::VERSION | ||
spec.version = RuboCop::RailsAccessibility::VERSION | ||
spec.authors = ["GitHub Accessibility Team"] | ||
spec.email = ["[email protected]"] | ||
|
||
spec.summary = "Custom extension for RuboCop." | ||
spec.summary = "Custom RuboCop rules for Rails Accessibility." | ||
spec.homepage = "https://github.com/github/rubocop-rails-accessibility" | ||
spec.license = "MIT" | ||
spec.required_ruby_version = ">= 2.7.0" | ||
|
@@ -28,14 +28,14 @@ Gem::Specification.new do |spec| | |
spec.add_development_dependency "rubocop-rails" | ||
spec.add_development_dependency "rubocop-performance" | ||
|
||
# Specify which files should be added to the gem when it is released. | ||
# The `git ls-files -z` loads the files in the RubyGem that have been added into git. | ||
spec.files = Dir.chdir(File.expand_path(__dir__)) do | ||
`git ls-files -z`.split("\x0").reject do |f| | ||
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)}) | ||
end | ||
end | ||
spec.bindir = "exe" | ||
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } | ||
spec.files = Dir[ | ||
"config/*.yml", | ||
"guides/*.md", | ||
"lib/**/*.rb", | ||
"CONTRIBUTING.md", | ||
"LICENSE", | ||
"README.md", | ||
] | ||
|
||
spec.require_paths = ["lib"] | ||
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 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