Skip to content
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

config: lint pr #100

Closed
wants to merge 2 commits into from
Closed
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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ jobs:
with:
bundler-cache: true

- name: Get file changes
id: get_file_changes
uses: trilom/[email protected]
with:
output: ' '

- name: Filter Ruby files
id: filter_ruby_files
run: |
files="${{ steps.get_file_changes.outputs.files }}"
ruby_files=$(echo "$files" | tr ' ' '\n' | grep '\.rb$' | tr '\n' ' ')
echo "::set-output name=ruby_files::$ruby_files"

- name: Echo Ruby file changes
run: |
echo Changed Ruby files: ${{ steps.filter_ruby_files.outputs.ruby_files }}

- name: Lint Pull Request
uses: wearerequired/lint-action@v2
with:
rubocop: true
rubocop_args: --fail-level C --display-only-fail-level-offenses ${{ steps.filter_ruby_files.outputs.ruby_files }}
rubocop_command_prefix: bundle exec

- name: Lint Ruby files
run: bundle exec rubocop

Expand Down
2 changes: 1 addition & 1 deletion spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
it { is_expected.to accept_nested_attributes_for(:profile) }
end

describe "validations" do
describe 'validations' do

Check warning on line 14 in spec/models/user_spec.rb

View workflow job for this annotation

GitHub Actions / RuboCop

spec/models/user_spec.rb#L14

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping (Style/StringLiterals)
it { is_expected.to validate_presence_of(:profile) }
end
end
Loading