tasking-manager icon indicating copy to clipboard operation
tasking-manager copied to clipboard

Add pre-commit hooks for code checks

Open mahesh-naxa opened this issue 1 year ago • 3 comments

What type of PR is this? (check all applicable)

  • [ ] 🍕 Feature
  • [ ] 🐛 Bug Fix
  • [ ] 📝 Documentation
  • [ ] 🧑‍💻 Refactor
  • [ ] ✅ Test
  • [x] 🤖 Build or CI
  • [ ] ❓ Other (please specify)

Describe this PR

We had no mechanism to perform checks for the code that has been pushed as mentioned #5714 . Also since the integration of pre-commit.ci we have been facing checks failing due to lack of pre-commit-config.yaml within the project.

Need of Further Investigation (⚠️ )

  • For https://github.com/pre-commit/mirrors-prettier checks, autofix didn't fix all the issues so fronend team should have to look into depth. Currently is commented out.
  • https://github.com/asottile/dead similarly had also flagged many portion of the code that were unused, But this should be confirmed by dev team & then we can have this enabled as well.
  • for pretty-format-json hook, that would format all json files, this caused tests to fail, i believe this is due to some test cases that wouldn't parse successfully. Needs more investigation from backend team, as just formatting the *.json the tests shouldn't have failed.

Screenshots

Screenshot 2024-05-03 at 9 42 15 AM Screenshot 2024-05-03 at 10 10 41 AM

mahesh-naxa avatar May 03 '24 04:05 mahesh-naxa

@eternaltyro the build and push seems to fail, if reran. It did pass the first time i created this PR, but failed once i had more commits pushed to this branch. Just letting you know.

mahesh-naxa avatar May 03 '24 04:05 mahesh-naxa

@dakotabenjamin i have 3 of those commented since they messed up our code and autofix didn't work. Need more input from dev end on those. May be we should create new issues about that.

mahesh-naxa avatar May 03 '24 04:05 mahesh-naxa