-
Notifications
You must be signed in to change notification settings - Fork 2.2k
dev: Add CI doc prettier check to local rust_lint.sh
#19254
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # 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. | ||
|
|
||
| SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")" | ||
| echo "$SCRIPT_PATH: Checking document format with prettier" | ||
|
|
||
| # Ensure `npx` is available | ||
| if ! command -v npx >/dev/null 2>&1; then | ||
| echo "npx is required to run the prettier check. Install Node.js (e.g., brew install node) and re-run." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # if you encounter error, change '--check' to '--write' in the below command, and | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested this out locally and it worked great for me: I think it would be even nicer / better if it could also make the changes as well (so people don't have to do a second step to update the prettier docs) For example, if the check fails, maybe it could automatically re-run prettier with Or maybe the script could accept a $ ./ci/scripts/doc_prettier_check.sh --write
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! Updated in 573fd64 Now for check failures, the error message look like And we can use I think there are several other potential auto fixes we can do, they can all be wrapped inside the lint script with This idea is tracked in #19227 |
||
| # commit the change. | ||
| # | ||
| # Ignore subproject CHANGELOG.md because it is machine generated | ||
| npx prettier@2.7.1 --check \ | ||
| '{datafusion,datafusion-cli,datafusion-examples,dev,docs}/**/*.md' \ | ||
| '!datafusion/CHANGELOG.md' \ | ||
| README.md \ | ||
| CONTRIBUTING.md | ||
| status=$? | ||
|
|
||
| if [ $status -ne 0 ]; then | ||
| echo "Prettier check failed. To fix, rerun `prettier` with --write (change --check to --write in the script), commit the formatted files, and re-run the check." >&2 | ||
| exit $status | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ DataFusion operators expose runtime metrics so you can understand where time is | |
| | Metric | Description | | ||
| | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | elapsed_compute | CPU time the operator actively spends processing work. | | ||
| | output_rows | Total number of rows the operator produces. | | ||
| | output_rows | Total number of rows the operator produces. | | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Injecting this It failed in https://github.com/apache/datafusion/actions/runs/20094525462/job/57649510711?pr=19254 |
||
| | output_bytes | Memory usage of all output batches. Note: This value may be overestimated. If multiple output `RecordBatch` instances share underlying memory buffers, their sizes will be counted multiple times. | | ||
| | output_batches | Total number of output batches the operator produces. | | ||
|
|
||
|
|
||
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.
👍