Closed jdemelo closed 2 years ago
btw, I was thinking we may want to add a pre-commit config (basically copying orghooks.yml) + tox.ini (maybe just a top-level symlink since it already lives in this repo?) to this repo and doing a pre-commit run --all-files
. this repo already contains all the template files + tests for start-release and whatnot, so it would capture if we missed other edge cases like this
I actually did the two things above yesterday (add pre-commit and run on all files), but the tests failed so I didn't delve into fixing them. as such not sure how much effort it might take, so it could be done in a separate PR as well 🙂
btw, I was thinking we may want to add a pre-commit config (basically copying orghooks.yml) + tox.ini (maybe just a top-level symlink since it already lives in this repo?) to this repo and doing a
pre-commit run --all-files
. this repo already contains all the template files + tests for start-release and whatnot, so it would capture if we missed other edge cases like thisI actually did the two things above yesterday (add pre-commit and run on all files), but the tests failed so I didn't delve into fixing them. as such not sure how much effort it might take, so it could be done in a separate PR as well 🙂
Oh nice! I would think we should treat them separately. It would be good to start preventing the ongoing markdown edits ASAP.
also cc: @shiyingtu
Some markdown files are getting modified as part of pre-commit hook execution. We should prevent this from happening, since the changes (even whitespace only) can modify how the documents are formatted.
Testing
Before
README.md is modified
``` jdemelo@C02D2551MD6R> splunk-soar-connectors (, play1.dev.us-wes) $ git clone git@github.com:splunk-soar-connectors/autofocus.git Cloning into 'autofocus'... remote: Enumerating objects: 182, done. remote: Counting objects: 100% (182/182), done. remote: Compressing objects: 100% (126/126), done. remote: Total 182 (delta 76), reused 141 (delta 52), pack-reused 0 Receiving objects: 100% (182/182), 825.33 KiB | 1.13 MiB/s, done. Resolving deltas: 100% (76/76), done. jdemelo@C02D2551MD6R> splunk-soar-connectors (, play1.dev.us-wes) $ cd autofocus jdemelo@C02D2551MD6R> autofocus (next, play1.dev.us-wes) $ pre-commit run --all-files [INFO] Initializing environment for https://github.com/phantomcyber/dev-cicd-tools. [INFO] Initializing environment for https://github.com/Yelp/detect-secrets. [INFO] Installing environment for https://github.com/Yelp/detect-secrets. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... org-wide hooks...........................................................Failed ... jdemelo@C02D2551MD6R> autofocus (next, play1.dev.us-wes) $ git status On branch next Your branch is up to date with 'origin/next'. Changes not staged for commit: (use "git add/rmAfter
README.md is not modified
``` jdemelo@C02D2551MD6R> splunk-soar-connectors (, play1.dev.us-wes) $ git clone git@github.com:splunk-soar-connectors/autofocus.git Cloning into 'autofocus'... remote: Enumerating objects: 182, done. remote: Counting objects: 100% (182/182), done. remote: Compressing objects: 100% (126/126), done. remote: Total 182 (delta 76), reused 141 (delta 52), pack-reused 0 Receiving objects: 100% (182/182), 825.33 KiB | 1.38 MiB/s, done. Resolving deltas: 100% (76/76), done. jdemelo@C02D2551MD6R> splunk-soar-connectors (, play1.dev.us-wes) $ cd autofocus jdemelo@C02D2551MD6R> autofocus (next, play1.dev.us-wes) $ pre-commit try-repo https://github.com/phantomcyber/dev-cicd-tools --ref 64b2a413b862ccd2bad1373c2055237268d9f29c --all-files [INFO] Initializing environment for https://github.com/phantomcyber/dev-cicd-tools. =============================================================================== Using config: =============================================================================== repos: - repo: https://github.com/phantomcyber/dev-cicd-tools rev: 64b2a413b862ccd2bad1373c2055237268d9f29c hooks: - id: org-hook - id: package-app-dependencies ... jdemelo@C02D2551MD6R> autofocus (next, play1.dev.us-wes) $ git status On branch next Your branch is up to date with 'origin/next'. Changes not staged for commit: (use "git add/rm