-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying out reviewdog #19
Changes from 3 commits
1585e18
a466405
dfaafd7
dc227fa
cb52354
c7700f8
f3df95b
9e0bd11
977739f
8359549
ffe0f95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# modified from: | ||
# https://github.com/reviewdog/action-rubocop#example-usage | ||
# https://github.com/tk0miya/action-erblint#example-usage | ||
|
||
name: reviewdog | ||
on: [pull_request] | ||
jobs: | ||
rubocop: | ||
name: runner / rubocop | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: rubocop | ||
uses: reviewdog/action-rubocop@v2 | ||
with: | ||
rubocop_version: gemfile | ||
rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile | ||
reporter: github-pr-review # Default is github-pr-check | ||
|
||
erb-lint: | ||
name: runner / erb-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: erb-lint | ||
uses: reviewdog/action-erblint@v1 | ||
with: | ||
reporter: github-pr-review # This is the default |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<% # expects "work" %> | ||
<li id="work_<%= work.id %>" class="<% if is_author_of?(work) %>own <% end %><% if work.unrevealed? %>mystery <% end %>work <%= css_classes_for_creation_blurb(work) %>" role="article"> | ||
<%= render "works/work_module", work: work %> | ||
<li id="work_<%= work.id %>" class="works <% if is_author_of?(work) %>own <% end %><% if work.unrevealed? %>mystery <% end %>work <%= css_classes_for_creation_blurb(work) %>" role="article"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reported by reviewdog 🐶 |
||
<%=render "works/work_module", :work => work%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reported by reviewdog 🐶 |
||
<% if is_author_of?(work) %> | ||
<h6 class="landmark heading"><%= ts("Author Actions") %></h6> | ||
<ul class="actions" role="navigation"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/GuardClause: Use a guard clause (return if self.users.include?(self.work_skin.author)||(self.work_skin.public?&&self.work_skin.official?)) instead of wrapping the code inside a conditional expression.
[Correctable] Style/IfUnlessModifier: Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
[Correctable] Layout/SpaceAroundOperators: Surrounding space missing for operator ||.
[Correctable] Layout/SpaceAroundOperators: Surrounding space missing for operator &&.