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

Tweak some words improved representation #614

Merged
merged 2 commits into from May 13, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -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

Expand Down Expand Up @@ -54,7 +54,7 @@ workflows:
nightly:
triggers:
- schedule:
cron: "30 23 * * 1,2,3" # 8:30am every Tuesday, Wednsday and Thursday (JST)
cron: "30 23 * * 1,2,3" # 8:30am every Tuesday, Wednesday and Thursday (JST)
filters:
branches:
only:
Expand Down
36 changes: 18 additions & 18 deletions spec/lib/rubocop_challenger/rubocop/todo_reader_spec.rb
Expand Up @@ -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).
Expand All @@ -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).
Expand All @@ -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).
Expand All @@ -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:
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -132,25 +132,25 @@
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

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

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