joelparkerhenderson / architecture-decision-record

Architecture decision record (ADR) examples for software planning, IT leadership, and template documentation
Other
11.59k stars 2.4k forks source link

ci: add pre-commit hook to remove trailing whitespaces #73

Open flavono123 opened 8 months ago

flavono123 commented 8 months ago

Goal

Descriptions

Requirements

Test

-### 제출자 +### 제출자

ADR 제출자를 나열합니다.



Signed-off-by: flavono123 <flavono123@gmail.com>
flavono123 commented 8 months ago

a suggestion for https://github.com/joelparkerhenderson/architecture-decision-record/pull/69#issuecomment-1804542664 by just creating this PR

joelparkerhenderson commented 8 months ago

Good idea. A few questions....

Can this kind of proofreading and changing have more capabilities?

Can the code be minimized in shell, by calling on installed software, such as installed on a CI server and/or GitHub actions and/or the developer's system?

Do you foresee what you're aiming for generally heading along the direction of a formatter and/or linter?

A few questions about the shell code...

Should this be ACMR?

--diff-filter=ACM 

I believe that stripspace is intended mostly for metadata, and there's a different whitespace=fix for committed files...?

git stripspace 

Ideally can a successful run be silent, akin to the Unix convention of silent success?

-if [ "$NEEDS_CLEANUP" = false ]; then
-  echo "no need to cleanup"
-fi

Can it run with guard flags, such as set -euf? Such as this:

Can you trap the mktemp? Because it's a good idea to trap an exception, such as this:

Could it be worthwhile to look for a longer-term larger-scope solution to make your idea even more powerful and valuable? Here are some that turned up when I looked... do any of these look like they can give you more capabilities?

Overall, my opinion is your code is fine to commit and use. I favor bias for action, and you're doing action. I appreciate you!

flavono123 commented 8 months ago

thank you for valuable and various points. but by answering the last one, that would resolve others too i think. and totally agree with the idea, using "a longer-term larger-scope solution", open-source standards, in other words, rather than the custom code snippet should be maintained.

in a nutshell, in advance, i prefer/think the choice is github action + megalinter:

the matter is pricing, no for megalinter but github action. but personal free tier is enough i guess: image https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes

joelparkerhenderson commented 8 months ago

Excellent research! Yes GitHub Action + MegaLinter sounds good. And I expect that the pricing on the free tier is OK.

If you want to try it, go ahead on this whole repo.