Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,21 @@ jobs:
run: bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rake
docs-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 3.0.x
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-build-rails-main-ruby-2.7.x-${{ hashFiles('**/Gemfile.lock') }}
- name: Verify docs coverage
run: |
gem install bundler:2.2.32
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec rake docs:coverage
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ inherit_gem:

AllCops:
NewCops: enable
SuggestExtensions: false

Rails/RefuteMethods:
Enabled: false

Style/Documentation:
Enabled: false

Rails/RakeEnvironment:
Enabled: false
Copy link
Collaborator Author

@khiga8 khiga8 Dec 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting a rubocop error for this line, Rails/RakeEnvironment, but disabling it because this repo isn't running a Rails app so this rule isn't applicable.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ linters:
enabled: true
```

### Rules
## Rules

- [GitHub::Accessibility::ImageHasAlt](./docs/rules/accessibility/no-aria-label-misuse.md)
- [GitHub::Accessibility::NoAriaLabelMisuse](./docs/rules/accessibility/image-has-alt.md)
- [GitHub::Accessibility::ImageHasAlt](./docs/rules/accessibility/image-has-alt.md)
- [GitHub::Accessibility::NoAriaLabelMisuse](./docs/rules/accessibility/no-aria-label-misuse.md)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing this mistake, while I'm here.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :)

- [GitHub::Accessibility::NoRedundantImageAlt](./docs/rules/accessibility/no-redundant-image-alt.md)

## Testing
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ Rake::TestTask.new do |t|
t.test_files = FileList[ENV["TESTS"] || "test/**/*_test.rb"]
end

Rake.add_rakelib "lib/tasks"

desc "Run tests"
task default: :test
17 changes: 17 additions & 0 deletions lib/tasks/docs.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

namespace :docs do
task :coverage do
require "erb_lint/all"
require "erblint-github/linters"

Dir[File.join(__dir__, "linters", "github/**/*.rb")].sort.each do |file|
rule_documentation_path = file
.gsub("#{__dir__}linters/github/", "docs/rules/")
.gsub(".rb", ".md")
.tr("_", "-")
raise "Missing rule documentation. Please document rule in #{rule_documentation_path}" unless File.file?(rule_documentation_path.to_s)
end
puts "All rules have been properly documented."
end
end