ephraimbuddy commented on pull request #19100: URL: https://github.com/apache/airflow/pull/19100#issuecomment-950270763
> @ephraimbuddy I have some doubts about the below command: > > ``` > entry: bash -c 'echo "If you think that this failure is an error, consider adding the word(s) > to the codespell dictionary at docs/spelling_wordlist.txt. > The word(s) should be in small letters." && exec codespell "$@"' -- > ``` > > why do we have to pass this as bash -c command rather than directly passing > > ``` > echo "If you think that this failure is an error, consider adding the word(s) > to the codespell dictionary at docs/spelling_wordlist.txt. > The word(s) should be in small letters." && exec codespell "$@" > ``` > > Also why does codespell should have "$@" for accessing arguments? Previously enty had only `codespell` in it. That's why i want to clarify. Thank you so much :) We are using ` bash -c` command because the entry point tells pre-commit what to run and here, instead of a custom hook, I want to write bash script directly. The `-c` helps in this by wrapping the whole command in strings. The "$@" will help bash take arguments from `args:` which pre-commit will pass to it. We can't do what you suggested because the arguments won't be parsed correctly by pre-commit -- 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]
