Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joenas/preek
View your code smells in color!
https://github.com/joenas/preek
Last synced: 15 days ago
JSON representation
View your code smells in color!
- Host: GitHub
- URL: https://github.com/joenas/preek
- Owner: joenas
- License: mit
- Created: 2013-01-30T16:52:59.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-01-20T13:57:18.000Z (almost 10 years ago)
- Last Synced: 2024-10-10T16:13:55.095Z (27 days ago)
- Language: Ruby
- Homepage:
- Size: 527 KB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Gem Version](https://badge.fury.io/rb/preek.png)](http://badge.fury.io/rb/preek)
[![Code Climate](https://codeclimate.com/github/joenas/preek.png)](https://codeclimate.com/github/joenas/preek)
[![Build Status](https://travis-ci.org/joenas/preek.png)](https://travis-ci.org/joenas/preek)
[![Dependency Status](https://gemnasium.com/joenas/preek.png)](https://gemnasium.com/joenas/preek)
[![Coverage Status](https://coveralls.io/repos/joenas/preek/badge.png?branch=master)](https://coveralls.io/r/joenas/preek?branch=master)# Preek
For a pretty colorful output of [Reek](https://github.com/troessner/reek), which is an awesome gem!
This is just something I came up with while learning [Thor](https://github.com/wycats/thor).
To make your refactoring life easier you can also use [Guard::Preek](https://github.com/joenas/guard-preek)!## Installation
$ gem install preek
From source
$ git clone [email protected]:joenas/preek.git
$ cd preek
$ rake install## Usage
### CLI
```bash
Usage:
preek FILE(S)|DIROptions:
-i, [--irresponsible] # Include IrresponsibleModule smell in output.
-c, [--compact] # Compact output.
-v, [--verbose] # Report files with no smellsCommands:
preek git # Run Preek on git changes
preek help [COMMAND] # Describe available commands or one specific command
preek smell FILE(S)|DIR # Pretty format Reek output
preek version # Shows version
```At the moment it only supports files, not stuff like this:
$ echo "def x() true end" | reek
### Ruby
```ruby
# Convenience method, prints all smells in filesfilenames = Dir['**/*.rb']
Preek::Smell(filenames)# To exclude certain smell classes
excludes = %w(IrresponsibleModule)
Preek::Smell(filenames, excludes)```
### Git
To run preek on your code before commit, place this in `.git/hooks/pre-commit````bash
#!/bin/sh
exec bundle exec preek git
0
```## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request