Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

RuboCop #65

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

Merged
merged 6 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Check format with a rake task
  • Loading branch information
kddnewton committed May 5, 2022
commit d67cb708c697e5aba2390f7bd0fe4d2765b0351f
19 changes: 18 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,26 @@ jobs:
ruby-version: ${{ matrix.ruby }}
- name: Test
run: bundle exec rake test

check:
name: Check
runs-on: ubuntu-latest
env:
CI: true
steps:
- uses: actions/checkout@master
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.1'
- name: Check
run: bundle exec rake check

automerge:
name: AutoMerge
needs: ci
needs:
- ci
- check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]'
steps:
Expand Down
22 changes: 22 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,25 @@ Rake::TestTask.new(:test) do |t|
end

task default: :test

FILEPATHS = %w[
Gemfile
Rakefile
syntax_tree.gemspec
lib/**/*.rb
test/*.rb
].freeze

task :syntax_tree do
$:.unshift File.expand_path("lib", __dir__)
require "syntax_tree"
require "syntax_tree/cli"
end

task check: :syntax_tree do
exit SyntaxTree::CLI.run(["check"] + FILEPATHS)
end

task format: :syntax_tree do
exit SyntaxTree::CLI.run(["write"] + FILEPATHS)
end