-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-45398: [CI][Dev][Ruby] Add Ruby lint #45417
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
Conversation
|
|
|
This PR relates to Ruby. @kou Please check this too. |
.pre-commit-config.yaml
Outdated
| ( | ||
| ?^dev/tasks/homebrew-formulae/.*\.rb$| | ||
| ) | ||
| files: .*\.rb$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this part and if the line width is 90, the pre-check claims the following
As we discussed on this #45403 (comment),
we need to exclude homebrew formulae. So, I added this part.
diff --git a/dev/tasks/homebrew-formulae/apache-arrow.rb b/dev/tasks/homebrew-formulae/apache-arrow.rb
index caf82b8db..01611d17b 100644
--- a/dev/tasks/homebrew-formulae/apache-arrow.rb
+++ b/dev/tasks/homebrew-formulae/apache-arrow.rb
@@ -110,7 +110,8 @@ class ApacheArrow < Formula
return 0;
}
EOS
- system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", "-L#{lib}", "-larrow", "-o", "test"
+ system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", "-L#{lib}", "-larrow",
+ "-o", "test"
system "./test"
end
endThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev/tasks/homebrew-formulae/*.rb should be excluded by exclude not files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar pre-commit configuration. I thought you commented exclude part. But you commented about the files part? If so, It seems OK to delete that part.
Do you mean this?
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8dcbeaece..cc46728b0 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -152,7 +152,6 @@ repos:
(
?^dev/tasks/homebrew-formulae/.*\.rb$|
)
- files: .*\.rb$
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed files part. It seems to work well.
pre-commit run --verbose --all-files --color=always --show-diff-on-failure ruby-format
Ruby Format..............................................................Passed
- hook id: rubocop
- duration: 1.66s
Inspecting 84 files
....................................................................................
84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................
84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................
84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................
84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................
84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................
84 files inspected, no offenses detected
Inspecting 84 files
....................................................................................
84 files inspected, no offenses detected
Inspecting 77 files
.............................................................................
77 files inspected, no offenses detected
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
kou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 6305c6e. There were 8 benchmark results with an error:
There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Rationale for this change
Multiple users are developing Ruby codes. Adding Ruby Lint helps keep the same style.
What changes are included in this PR?
Add Ruby Lint. (Rubocop)
Are these changes tested?
Yes.
Are there any user-facing changes?
No.