You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/17 13:10:48 UTC
[GitHub] [arrow] mqy opened a new pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
mqy opened a new pull request #8953:
URL: https://github.com/apache/arrow/pull/8953
If a commit contains only fixes for rust format, it would be very sad to wait for the slow CI checking done, and it may block checking of PRs.
So, this PR adds a git pre-commit hook file, which performs the "cargo fmt --check"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#issuecomment-747440973
https://issues.apache.org/jira/browse/ARROW-10952
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] Dandandan commented on pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
Dandandan commented on pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#issuecomment-748262754
Pre-commit hooks :+1:
First thoughts:
* Why not just `fmt` instead of check?
* Would it make sense to run clippy too?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] alamb commented on a change in pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#discussion_r545479593
##########
File path: rust/pre-commit.sh
##########
@@ -0,0 +1,56 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#!/bin/sh
Review comment:
Doesn't the `#!` have to be the first line in the file to have an effect?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] alamb commented on pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#issuecomment-748525420
I think this is looking good @mqy -- thanks for the doc updates. Given it is an opt in and well documented, I am merging this in and we can iterate in subsequent PRs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] mqy commented on a change in pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
mqy commented on a change in pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#discussion_r546073470
##########
File path: rust/README.md
##########
@@ -110,6 +110,9 @@ PR be sure to run the following and check for lint issues:
cargo +stable fmt --all -- --check
```
+We can use "git pre-commit hook" to automate this process: copy or soft link [pre-commit.sh](pre-commit.sh)
+as file `.git/hooks/pre-commit`.
Review comment:
@jorgecarleitao good idea!
I have tried this way but finally aborted.
One of the reason is: one line command for copy/paste is not enough -- if the pre-commit file already exists, copy/link may fail or override them unexpectedly, thus additional check/prompt would make the commands lengthy.
Anyway, let me try again.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] codecov-io edited a comment on pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#issuecomment-747436190
# [Codecov](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=h1) Report
> Merging [#8953](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=desc) (32177e9) into [master](https://codecov.io/gh/apache/arrow/commit/d65ba4ec5daeb93ca5031f883d08d559b68753b2?el=desc) (d65ba4e) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/arrow/pull/8953/graphs/tree.svg?width=650&height=150&src=pr&token=LpTCFbqVT1)](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8953 +/- ##
=======================================
Coverage 83.25% 83.25%
=======================================
Files 196 196
Lines 48116 48192 +76
=======================================
+ Hits 40059 40124 +65
- Misses 8057 8068 +11
```
| [Impacted Files](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [rust/parquet/src/arrow/array\_reader.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9wYXJxdWV0L3NyYy9hcnJvdy9hcnJheV9yZWFkZXIucnM=) | `77.00% <0.00%> (-0.56%)` | :arrow_down: |
| [rust/parquet/src/arrow/schema.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9wYXJxdWV0L3NyYy9hcnJvdy9zY2hlbWEucnM=) | `91.31% <0.00%> (-0.50%)` | :arrow_down: |
| [rust/parquet/src/encodings/encoding.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9wYXJxdWV0L3NyYy9lbmNvZGluZ3MvZW5jb2RpbmcucnM=) | `95.24% <0.00%> (-0.20%)` | :arrow_down: |
| [rust/parquet/src/file/statistics.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9wYXJxdWV0L3NyYy9maWxlL3N0YXRpc3RpY3MucnM=) | `93.80% <0.00%> (ø)` | |
| [rust/arrow/src/array/array\_binary.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9hcnJvdy9zcmMvYXJyYXkvYXJyYXlfYmluYXJ5LnJz) | `90.73% <0.00%> (+0.21%)` | :arrow_up: |
| [rust/parquet/src/schema/types.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9wYXJxdWV0L3NyYy9zY2hlbWEvdHlwZXMucnM=) | `90.19% <0.00%> (+0.26%)` | :arrow_up: |
| [rust/datafusion/src/datasource/parquet.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9kYXRhZnVzaW9uL3NyYy9kYXRhc291cmNlL3BhcnF1ZXQucnM=) | `95.62% <0.00%> (+0.30%)` | :arrow_up: |
| [rust/parquet/src/arrow/arrow\_reader.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9wYXJxdWV0L3NyYy9hcnJvdy9hcnJvd19yZWFkZXIucnM=) | `91.25% <0.00%> (+0.66%)` | :arrow_up: |
| [rust/parquet/src/file/metadata.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9wYXJxdWV0L3NyYy9maWxlL21ldGFkYXRhLnJz) | `91.82% <0.00%> (+0.77%)` | :arrow_up: |
| [rust/datafusion/src/physical\_plan/parquet.rs](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree#diff-cnVzdC9kYXRhZnVzaW9uL3NyYy9waHlzaWNhbF9wbGFuL3BhcnF1ZXQucnM=) | `79.56% <0.00%> (+0.91%)` | :arrow_up: |
| ... and [1 more](https://codecov.io/gh/apache/arrow/pull/8953/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=footer). Last update [d65ba4e...32177e9](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] mqy commented on pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
mqy commented on pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#issuecomment-748296722
> Pre-commit hooks 👍
>
> First thoughts:
>
> * Why not just `fmt` instead of check?
> * Would it make sense to run clippy too?
I'm glad to add above tasks as our new client side tiny git flow :) Let me try!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jorgecarleitao commented on a change in pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
jorgecarleitao commented on a change in pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#discussion_r546031447
##########
File path: rust/README.md
##########
@@ -110,6 +110,9 @@ PR be sure to run the following and check for lint issues:
cargo +stable fmt --all -- --check
```
+We can use "git pre-commit hook" to automate this process: copy or soft link [pre-commit.sh](pre-commit.sh)
+as file `.git/hooks/pre-commit`.
Review comment:
Just to make it dead simple to people less experienced in git, would it be possible to paste the command here? E.g.
```bash
cp rust/pre-commit.sh ../.git/hooks/pre-commit
```
or
```bash
ln ...
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] mqy commented on a change in pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
mqy commented on a change in pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#discussion_r545531696
##########
File path: rust/pre-commit.sh
##########
@@ -0,0 +1,56 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#!/bin/sh
Review comment:
@alamb Fixed, thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] codecov-io commented on pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#issuecomment-747436190
# [Codecov](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=h1) Report
> Merging [#8953](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=desc) (f38fc19) into [master](https://codecov.io/gh/apache/arrow/commit/d65ba4ec5daeb93ca5031f883d08d559b68753b2?el=desc) (d65ba4e) will **not change** coverage.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/arrow/pull/8953/graphs/tree.svg?width=650&height=150&src=pr&token=LpTCFbqVT1)](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8953 +/- ##
=======================================
Coverage 83.25% 83.25%
=======================================
Files 196 196
Lines 48116 48116
=======================================
Hits 40059 40059
Misses 8057 8057
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=footer). Last update [d65ba4e...f38fc19](https://codecov.io/gh/apache/arrow/pull/8953?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] alamb closed pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
alamb closed pull request #8953:
URL: https://github.com/apache/arrow/pull/8953
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] mqy commented on pull request #8953: ARROW-10952: [Rust] Add pre-commit hook
Posted by GitBox <gi...@apache.org>.
mqy commented on pull request #8953:
URL: https://github.com/apache/arrow/pull/8953#issuecomment-748382223
Updated. NOTE: /bin/sh was changed to /bin/bash
Although I had a few experience on TTY color before, honestly speaking, I'm not quite confident about the color behavior on various shells. Feed back welcome!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org