Exclude minio folder from rubocop evaluation
🌳 Context
Object storage is a central component of the GitLab architecture. Among other things, it is the storage for the package registry features. Among them, we have the rubygems package registry.
So, locally, we could have a minio server filled with ruby gems.
Now, guess what happens when we work on GDK and we run the tests ($ make test
) or the git callbacks (lefthook
) are executed?
rubocop
gets executed and it will try to validate all ruby files and when I say all, yes, that's including those from the minio storage folder:
Lefthook v1.0.3
RUNNING HOOK: pre-push
EXECUTE > test
Checkmake: OK
Vale: ✔ 0 errors, 0 warnings and 0 suggestions in 74 files.
MarkdownLint: OK
Check internal links: OK
Shellcheck: OK
RuboCop: Inspecting 249 files
............................................................................................................................CCCCCCCCCCC..................................................................................................................
Offenses:
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/47/files/48/hola.gemspec:1:1: C: Gemspec/RequiredRubyVersion: required_ruby_version should be specified.
# -*- encoding: utf-8 -*-
^
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/47/files/48/hola.gemspec:1:1: C: Style/Encoding: Unnecessary utf-8 encoding comment.
# -*- encoding: utf-8 -*-
^^^^^^^^^^^^^^^^^^^^^^^^^
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/47/files/48/hola.gemspec:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
# -*- encoding: utf-8 -*-
^
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/49/files/52/hola.gemspec:1:1: C: Gemspec/RequiredRubyVersion: required_ruby_version should be specified.
# -*- encoding: utf-8 -*-
^
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/49/files/52/hola.gemspec:1:1: C: Style/Encoding: Unnecessary utf-8 encoding comment.
# -*- encoding: utf-8 -*-
^^^^^^^^^^^^^^^^^^^^^^^^^
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/49/files/52/hola.gemspec:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
# -*- encoding: utf-8 -*-
^
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/49/files/53/hola.gemspec:1:1: C: Gemspec/RequiredRubyVersion: required_ruby_version should be specified.
# -*- encoding: utf-8 -*-
^
minio/data/packages/33/46/3346f2bbf6c34bd2dbe28bd1bb657d0e9c37392a1d5ec9929e6a5df4763ddc2d/packages/49/files/53/hola.gemspec:1:1: C: Style/Encoding: Unnecessary utf-8 encoding comment.
[... snip snip ...]
249 files inspected, 33 offenses detected, 22 offenses auto-correctable
make: *** [rubocop] Error 1
SUMMARY: (done in 41.77 seconds)
🥊 test
error: failed to push some refs to 'gitlab.com:gitlab-org/gitlab-development-kit.git'
rubocop
will try to validate ruby gems files from the rubygems package registry
🔬 What does this Merge Request do and why?
- Exclude the
minio
folder from rubocop evaluation.
🚥 Merge Request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. - [-] Tests added for new functionality. If not, please raise Issue to follow-up.
- [-] Documentation added/updated, if needed.
- [-]
gdk doctor
test added, if needed. - [-] Add the
~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by David Fernandez