diff --git a/README.md b/README.md index 93b3766..8eb273c 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ On the other hand, `rubocop` has [`--auto-correct`](https://github.com/rubocop-h It is ideal that to remove a disabled rule from `.rubocop_todo.yml` every day, to check whether it passes test, and can be obtained consent from the team. But it requires strong persistence and time. I call such work *Rubocop Challenge*. And the *RubocopChallenger* is a gem to support this challenge! -## The history of RubocopChallenger with decrease of offence codes +## The history of RubocopChallenger with decrease of offense codes -The following chart shows the history of RubocopChallenger and decrease of offence codes at a `.rubocop_todo.yml`. The project was released at 5 years ago, and then it was introduced the RuboCop gem for huge source code including a lots of offence codes. Before using the RubocopChallenger, it was not maintain to reduce offence codes. One day, I felt a crisis and started maintain with manual. I made a lots of Pull Requests to reduce them but it's a load for me and reviewers. So I created a script for automation the flow, which is the predecessor of Rubocop Challenger gem. It brought reducing the offence codes continuously. After 8 months, finally it has done. There is no auto-correctable offence codes. -But there are many offences which is un-auto-correctable yet. I will try to reduce it with the RubocopChallenger. The RubocopChallenger will +The following chart shows the history of RubocopChallenger and decrease of offense codes at a `.rubocop_todo.yml`. The project was released at 5 years ago, and then it was introduced the RuboCop gem for huge source code including a lots of offense codes. Before using the RubocopChallenger, it was not maintain to reduce offense codes. One day, I felt a crisis and started maintain with manual. I made a lots of Pull Requests to reduce them but it's a load for me and reviewers. So I created a script for automation the flow, which is the predecessor of Rubocop Challenger gem. It brought reducing the offense codes continuously. After 8 months, finally it has done. There is no auto-correctable offense codes. +But there are many offenses which is un-auto-correctable yet. I will try to reduce it with the RubocopChallenger. The RubocopChallenger will be continued to evolve. -![Decrease of offence codes](images/decrease_of_offence_codes.png) +![Decrease of offense codes](images/decrease_of_offense_codes.png) ## Rubocop Challenge Flow diff --git a/spec/lib/rubocop_challenger/rubocop/todo_reader_spec.rb b/spec/lib/rubocop_challenger/rubocop/todo_reader_spec.rb index f72c961..a4b2528 100644 --- a/spec/lib/rubocop_challenger/rubocop/todo_reader_spec.rb +++ b/spec/lib/rubocop_challenger/rubocop/todo_reader_spec.rb @@ -5,7 +5,7 @@ RSpec.describe RubocopChallenger::Rubocop::TodoReader do let(:todo_reader) { described_class.new('spec/fixtures/.rubocop_todo.yml') } - let(:autocorrectable_rule_which_offence_count_is_1) do + let(:autocorrectable_rule_which_offense_count_is_1) do RubocopChallenger::Rubocop::Rule.new(<<~CONTENTS) # Offense count: 1 # This cop supports safe auto-correction (--auto-correct). @@ -17,7 +17,7 @@ CONTENTS end - let(:autocorrectable_rule_which_offence_count_is_2) do + let(:autocorrectable_rule_which_offense_count_is_2) do RubocopChallenger::Rubocop::Rule.new(<<~CONTENTS) # Offense count: 2 # This cop supports safe auto-correction (--auto-correct). @@ -27,7 +27,7 @@ CONTENTS end - let(:autocorrectable_rule_which_offence_count_is_13) do + let(:autocorrectable_rule_which_offense_count_is_13) do RubocopChallenger::Rubocop::Rule.new(<<~CONTENTS) # Offense count: 13 # This cop supports safe auto-correction (--auto-correct). @@ -51,7 +51,7 @@ CONTENTS end - let(:unautocorrectable_rule_which_offence_count_is_4) do + let(:unautocorrectable_rule_which_offense_count_is_4) do RubocopChallenger::Rubocop::Rule.new(<<~CONTENTS) # Offense count: 4 Style/Documentation: @@ -74,10 +74,10 @@ describe '#all_rules' do let(:rules_which_are_ordered_by_offense_count) do [ - autocorrectable_rule_which_offence_count_is_1, - autocorrectable_rule_which_offence_count_is_2, - unautocorrectable_rule_which_offence_count_is_4, - autocorrectable_rule_which_offence_count_is_13 + autocorrectable_rule_which_offense_count_is_1, + autocorrectable_rule_which_offense_count_is_2, + unautocorrectable_rule_which_offense_count_is_4, + autocorrectable_rule_which_offense_count_is_13 ] end @@ -107,8 +107,8 @@ it 'rejects to be ignored rules' do expect(todo_reader.all_rules).to eq [ - autocorrectable_rule_which_offence_count_is_2, - unautocorrectable_rule_which_offence_count_is_4 + autocorrectable_rule_which_offense_count_is_2, + unautocorrectable_rule_which_offense_count_is_4 ] end end @@ -117,9 +117,9 @@ describe '#auto_correctable_rules' do let(:rules_which_are_ordered_by_offense_count) do [ - autocorrectable_rule_which_offence_count_is_1, - autocorrectable_rule_which_offence_count_is_2, - autocorrectable_rule_which_offence_count_is_13 + autocorrectable_rule_which_offense_count_is_1, + autocorrectable_rule_which_offense_count_is_2, + autocorrectable_rule_which_offense_count_is_13 ] end @@ -132,7 +132,7 @@ describe '#least_occurrence_rule' do it 'returns a auto correctable rule with the least count of occurrences' do expect(todo_reader.least_occurrence_rule).to eq( - autocorrectable_rule_which_offence_count_is_1 + autocorrectable_rule_which_offense_count_is_1 ) end end @@ -140,7 +140,7 @@ describe '#most_occurrence_rule' do it 'returns a auto correctable rule with the most count of occurrences' do expect(todo_reader.most_occurrence_rule).to eq( - autocorrectable_rule_which_offence_count_is_13 + autocorrectable_rule_which_offense_count_is_13 ) end end @@ -148,9 +148,9 @@ describe '#any_rule' do it 'returns a auto correctable rule at random' do expect(todo_reader.any_rule) - .to eq(autocorrectable_rule_which_offence_count_is_1) - .or eq(autocorrectable_rule_which_offence_count_is_2) - .or eq(autocorrectable_rule_which_offence_count_is_13) + .to eq(autocorrectable_rule_which_offense_count_is_1) + .or eq(autocorrectable_rule_which_offense_count_is_2) + .or eq(autocorrectable_rule_which_offense_count_is_13) end end end