Skip to content

Commit

Permalink
ability to run codeclimate locally (#3)
Browse files Browse the repository at this point in the history
* ability to run codeclimate locally

* run codeclimate from container

* dummy commit

* dummy commit
  • Loading branch information
bruce-szalwinski-he authored Feb 29, 2024
1 parent b1306cb commit f66d6f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
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

0 comments on commit f66d6f2

Please sign in to comment.