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

ability to run codeclimate locally #3

Merged
merged 4 commits into from
Feb 29, 2024
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
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,15 @@ To fix lint issues, run `rubocop`.
```bash
bundle exec rubocop -x
```
## Code Climate
## Code Climate

This project uses [code climate](https://github.com/marketplace/code-climate) to maintain code quality.
Code Climate will be run on every pull request and will fail if the code quality is not maintained.
Code climate can be run locally using the commands below.
Code climate can be run locally using the command below.

```bash
brew tap codeclimate/formulae
brew install codeclimate
bundle exec rake code_climate
bundle exec rake codeclimate
```

## CLI

Expand Down
20 changes: 3 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,9 @@ RuboCop::RakeTask.new

task default: %i[test rubocop]

# task :code_climate do
# sh "docker",
# "run",
# "--interactive",
# "--tty",
# "--rm",
# "--env",
# "CODECLIMATE_CODE=$(pwd)",
# "--volume",
# "$(pwd):/code",
# "--volume",
# "/var/run/docker.sock:/var/run/docker.sock",
# "--volume",
# "/tmp/cc:/tmp/cc",
# "codeclimate/codeclimate",
# "analyze"
# end
task :codeclimate do
sh "./codeclimate.sh", verbose: false
end

# == "rake release" enhancements ==============================================

Expand Down
9 changes: 9 additions & 0 deletions codeclimate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

docker run \
--interactive --tty --rm \
--env CODECLIMATE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
codeclimate/codeclimate analyze