Copilot commented on code in PR #41944:
URL: https://github.com/apache/superset/pull/41944#discussion_r3562473336
##########
.pre-commit-config.yaml:
##########
@@ -63,7 +63,7 @@ repos:
hooks:
- id: prettier-frontend
name: prettier (frontend)
- entry: bash -c 'cd superset-frontend && for file in "$@"; do npx
prettier --write "${file#superset-frontend/}"; done'
+ entry: bash -c 'cd superset-frontend && files=(); for f in "$@"; do
files+=("${f#superset-frontend/}"); done; npx prettier --write "${files[@]}"' --
Review Comment:
When invoking Prettier with a list of files, add a `--` end-of-options
separator before the filenames so a file whose basename starts with `-`/`--`
can’t be interpreted as a CLI option (e.g. `--plugin=...`). Without this, a
specially-named file under `superset-frontend/` could cause Prettier to treat
it as a flag instead of a path, breaking the hook and potentially changing
execution behavior.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]