Currently, the rubocop is working in pixta's repository with using configs and examples of pixta-rubocop. But it doesn't report problems when a code has problems.
Oh my God... I will check that with using configs and examples of pixta-rubocop in a new rails v4.2.x project. I used this .rubocop.yml(Refer to README of pixta-rubocop).
This one is the result. The target file is Rakefile and config.ru only. It can't use default configs of rubocop.
vagrant@ubuntu-bionic ~/s/g/p/rails-with-docker-compose ❯❯❯ rubocop -v
0.77.0
vagrant@ubuntu-bionic ~/s/g/h/rails-with-docker-compose ❯❯❯ rubocop --list-target-files ✘ 1
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for SingleLineMethods.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for Documentation.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for MultilineBlockChain.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for Lambda.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for ClassAndModuleChildren.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for FormatString.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for MethodLength.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for StringLiterals.
Warning: unrecognized cop Rails found in .rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml
Warning: unrecognized cop Rails found in .rubocop.yml
Rakefile
config.ru
We should fix that problem. Normally pixta-rubocop uses default configs of rubocop. But we customized some configs to PIXTA. So we also want to apply that mind to AllCops/Include and AllCops/Exclude. If that we can use inherit_mode. inherit_mode has two options merge and override.
https://docs.rubocop.org/en/stable/configuration/#merging-arrays-using-inherit_mode
In our case, we can specify inherit_mode/merge to AllCops/Include and AllCops/Exclude.
vagrant@ubuntu-bionic ~/s/g/p/rails-with-docker-compose ❯❯❯ rubocop -v
0.77.0
vagrant@ubuntu-bionic ~/s/g/h/rails-with-docker-compose ❯❯❯ rubocop --list-target-files
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for SingleLineMethods.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for Documentation.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for MultilineBlockChain.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for Lambda.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for ClassAndModuleChildren.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for FormatString.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for MethodLength.
/home/vagrant/src/github.com-for-hamuyuuki/hamuyuuki/rails-with-docker-compose/.rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml: Warning: no department given for StringLiterals.
Warning: unrecognized cop Rails found in .rubocop-https---raw-githubusercontent-com-pixta-dev-pixta-rubocop-master-rubocop-yml
Warning: unrecognized cop Rails found in .rubocop.yml
Rakefile
app/controllers/application_controller.rb
app/helpers/application_helper.rb
config.ru
test/test_helper.rb
This PR changes README and examples in the pixta-rubocop. After this PR is LGTM, we need to apply that configs to pixta's repository.
Currently, the
rubocop
is working in pixta's repository with using configs and examples ofpixta-rubocop
. But it doesn't report problems when a code has problems.Because from
rubocop
v0.56.0 it changed the behavior ofAllCops/Include
andAllCops/Exclude
to the overriding way. https://github.com/rubocop-hq/rubocop/blob/master/relnotes/v0.56.0.md#new-featuresYou can see this issue and pull request. https://github.com/rubocop-hq/rubocop/issues/4247 https://github.com/rubocop-hq/rubocop/pull/5882
Oh my God... I will check that with using configs and examples of
pixta-rubocop
in a new rails v4.2.x project. I used this.rubocop.yml
(Refer to README ofpixta-rubocop
).This one is the result. The target file is
Rakefile
andconfig.ru
only. It can't use default configs ofrubocop
.We should fix that problem. Normally
pixta-rubocop
uses default configs ofrubocop
. But we customized some configs to PIXTA. So we also want to apply that mind toAllCops/Include
andAllCops/Exclude
. If that we can useinherit_mode
.inherit_mode
has two optionsmerge
andoverride
. https://docs.rubocop.org/en/stable/configuration/#merging-arrays-using-inherit_modeIn our case, we can specify
inherit_mode/merge
toAllCops/Include
andAllCops/Exclude
.I also check that with using
inherit_mode/merge
.This one is the result. it works well 💯
This PR changes README and examples in the
pixta-rubocop
. After this PR is LGTM, we need to apply that configs to pixta's repository.