LGBTQ-of-the-day-bot icon indicating copy to clipboard operation
LGBTQ-of-the-day-bot copied to clipboard

Add a pre-commit hook to check for syntax errors

Open bobsany16 opened this issue 5 years ago • 12 comments

Is your feature request related to a problem? Please describe. Lots of times, entries to data files contain syntax errors like commas, periods, etc.,

Describe the solution you'd like Have an automated pre-commit hook that will check for these errors. If there are, the hook won't allow a push => prompts contributors to check their changes. This -> makes things easier for maintainer/organizer -> good practice of checking code for errors for everyone.

Additional context


Don't forget to follow the bot on Twitter to see the hard work you put in.

bobsany16 avatar Oct 07 '20 15:10 bobsany16

Oh! I had no clue that was something that could be done.

VickiLanger avatar Oct 07 '20 16:10 VickiLanger

Yup! I've seen a couple projects implement multiple sorts of pre-commit hooks but unfortunately, I have 0 experience with this. Would be a blast to work on though 😅. Unless someone can chime in for this, I'll attempt.

bobsany16 avatar Oct 07 '20 17:10 bobsany16

I found this, I might try this, if that's cool with you

bobsany16 avatar Oct 07 '20 18:10 bobsany16

Neat. I thought it was going to be some github actions type of thing. You're welcome to try it.

VickiLanger avatar Oct 07 '20 21:10 VickiLanger

If you haven't put too much work into the hooks. I think this python linter bot may do what we need

VickiLanger avatar Oct 11 '20 01:10 VickiLanger

oh awesome! I was just still doing some researches on the hooks but unfortunately wasn't doing too good 😅 and the python linter bot does make things easier. I assume it will check for errors and then if it doesn't pass, we could request changes in the PR, right ? If so, I think this is more feasible. Thanks for letting me know!

bobsany16 avatar Oct 11 '20 01:10 bobsany16

Um, I didn't look too hard yet. Just ran across it looking for something else

VickiLanger avatar Oct 11 '20 02:10 VickiLanger

alright, I'll take a look and let you know!

bobsany16 avatar Oct 11 '20 03:10 bobsany16

Do you mind sharing the repo that uses this ? I just wanted to see their .yml file configurations.

bobsany16 avatar Oct 11 '20 19:10 bobsany16

I found it in the GitHub actions page. I don't know of anyone specific who uses it. Though I'm sure many do use it

VickiLanger avatar Oct 14 '20 00:10 VickiLanger

have you guys figured something out? I'm looking for a way of making it stop failing at the same point every PR

lhfaguiar avatar Dec 02 '20 03:12 lhfaguiar

have you guys figured something out? I'm looking for a way of making it stop failing at the same point every PR

Personally, I haven't worked on it. Not sure if @bobsany16 has.

VickiLanger avatar Dec 02 '20 21:12 VickiLanger