-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from wteuber/appease_rubocop_and_mutant
Appease Rubocop and Mutant, Update README
- Loading branch information
Showing
36 changed files
with
714 additions
and
641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
includes: | ||
- lib | ||
requires: | ||
- yaml_normalizer | ||
integration: | ||
name: rspec | ||
matcher: | ||
subjects: | ||
- YamlNormalizer* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
require: | ||
- rubocop-performance | ||
- rubocop-rspec | ||
|
||
AllCops: | ||
TargetRubyVersion: 3.2 | ||
|
||
# Commonly used screens these days easily fit more than 80 characters. | ||
Metrics/LineLength: | ||
Max: 120 | ||
TargetRubyVersion: 3.0 | ||
NewCops: enable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,34 +34,30 @@ Yaml Normalizer can be used in frameworks like Rails, Sinatra or Cuba, but | |
it runs stand-alone as well. | ||
|
||
## Installation | ||
$ gem install yaml_normalizer | ||
gem install yaml_normalizer | ||
|
||
## Usage | ||
### Use executable files | ||
Yaml Normalizer provides you with two executables: `yaml_normalize` and `yaml_check`. | ||
This is how you run them in your terminal: | ||
To check and normalize ´a_yaml_file.yml´, run: | ||
|
||
$ yaml_check my_yaml_file.yml | ||
$ yaml_normalize my_yaml_file.yml | ||
yaml_check a_yaml_file.yml | ||
yaml_normalize a_yaml_file.yml | ||
|
||
To check the current version of yaml_normalizer type: | ||
$ yaml_check --version | ||
Print the installed version of Yaml Normalizer: | ||
|
||
or | ||
yaml_check --version | ||
|
||
$ yaml_normalize -v | ||
Print help messages for ´yaml_check´ and `yaml_normalize`: | ||
|
||
To see the help message for yaml_normalizer type: | ||
$ yaml_check --help | ||
|
||
or | ||
|
||
$ yaml_normalize -h | ||
yaml_check --help | ||
yaml_normalize --help | ||
|
||
### Include Yaml Normalizer rake tasks | ||
In your Gemfile, add | ||
|
||
gem 'yaml_normalizer', require: false | ||
|
||
In a Rails context, you might want to only add it to `:development` and `:test` groups. | ||
|
||
In your Rakefile, add | ||
|
@@ -77,52 +73,71 @@ This will give you two additional rake task (`rake -T`) | |
rake yaml:check # Check if configured YAML files are normalized | ||
rake yaml:normalize # Normalize configured YAML files | ||
|
||
|
||
## Development | ||
|
||
In order to start developing with Yaml Normalizer you need to install the following dependencies: | ||
Start developing Yaml Normalizer by installing the following dependencies: | ||
* [git](https://git-scm.com/downloads) (version control) | ||
* [Ruby](https://www.ruby-lang.org/en/documentation/installation/) (programming language) | ||
* [RubyGems](https://rubygems.org/pages/download) (package manager for Ruby) | ||
* [Bundler](http://bundler.io/) (dependency manager for RubyGems) | ||
|
||
##### Set up Yaml Normalizer | ||
$ git clone [email protected]:Sage/yaml_normalizer.git | ||
$ cd yaml_normalizer/ | ||
$ bundle install | ||
$ rake | ||
### Set up Yaml Normalizer | ||
git clone [email protected]:Sage/yaml_normalizer.git | ||
cd yaml_normalizer/ | ||
bundle install | ||
|
||
### List available rake tasks | ||
bundle exec rake -T | ||
``` | ||
rake ci # Continuous integration test suite (DEFAULT) | ||
rake flog # Analyze for code complexity in: lib | ||
rake inch # Check documentation coverage | ||
rake mutant # Mutation testing to check mutation coverage of current RSpec test suite | ||
rake rubocop # Run RuboCop | ||
rake rubocop:autocorrect # Autocorrect RuboCop offenses (only when it's safe) | ||
rake rubocop:autocorrect_all # Autocorrect RuboCop offenses (safe and unsafe) | ||
rake spec # Run RSpec code examples | ||
rake yard # Generate YARD Documentation | ||
``` | ||
|
||
### Generate documentation locally using Yard | ||
bundle exec rake yard | ||
After generating yard documentation, open generated index.html located in `doc/` in your browser. | ||
|
||
### Test documentation quality using Inch | ||
bundle exec rake inch | ||
inch list --all | ||
This task applies static code analysis to measure documentation quality. Inch also suggests improvements. | ||
|
||
#### Generate Documentation | ||
##### Using Yard | ||
$ bundle exec rake yard | ||
After generating yard documentation, open index.html at doc/ in your browser. | ||
### Run RSpec | ||
bundle exec rake spec | ||
rspec | ||
[RSpec](https://rubygems.org/gems/rspec) is a testing framework for Ruby. Running this task executes all tests located in `spec/`. | ||
|
||
#### Test Implementation | ||
##### Run continuous integration test suite | ||
$ bundle exec rake | ||
Running this task executes the following tasks: `inch` `rubocop` `ci_flog` `ci_spec` `mutant` | ||
### Check and Correct static code metrics using Rubocop | ||
bundle exec rake rubocop | ||
rubocop | ||
|
||
#### Test Documentation using Inch | ||
$ bundle exec rake inch | ||
This task applies static code analysis to measure documentation quality. Inch also suggests improvements. | ||
bundle exec rake rubocop:autocorrect | ||
rubocop -a | ||
|
||
##### Run Guard | ||
$ bundle exec guard | ||
Guard keeps track of file changes and automatically runs the unit tests related to changed files. | ||
bundle exec rake rubocop:autocorrect_all | ||
rubocop -A | ||
[Rubocop](https://rubygems.org/gems/rubocop) is a static code analyzer that checks for code quality and style issues. | ||
|
||
##### Run RSpec | ||
$ bundle exec rake spec | ||
This task runs the full unit test suite based on RSpec. | ||
### Run Flog (check complexity) | ||
bundle exec rake flog | ||
[Flog](https://rubygems.org/gems/flog) is a static code analyzer that checks for code complexity. | ||
|
||
#### Test Tests using mutant | ||
$ bundle exec rake mutant | ||
### Run Guard | ||
bundle exec guard | ||
[Guard](https://rubygems.org/gems/guard) keeps track of file changes and automatically runs tests related to updated files. | ||
|
||
#### Check and Correct static code metrics using Rubocop | ||
$ bundle exec rake rubocop | ||
$ bundle exec rake rubocop:auto_correct | ||
### Run continuous integration test suite | ||
bundle exec rake | ||
Running this task executes the following tasks: ´ci_spec´ ´inch´ ´ci_flog´ ´rubocop` | ||
|
||
#### Run Flog (check complexity) | ||
$ bundle exec flog -a lib | ||
### Test Tests using mutant (requires mutant-license) | ||
bundle exec rake mutant | ||
|
||
## Contributing | ||
Bug reports and pull requests are welcome on GitHub at | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.