Viewing a single comment thread. View all comments

3

musou wrote

i don't have a ton of advice because ultimately i think people just have to be motivated to want to do the things you think are good. but one thing that i have seen work is to try to automate as much of this stuff as possible because then it's more likely that they'll see the benefits without having it feel like a hassle.

for example, i do most of my day job work in elixir, my team's VCS is git, and we have to use jira to track work (i hate jira but that's a whole other story). elixir has some pretty nice tooling compared to languages i've used in the past, so i have a bunch of git hook scripts that run a bunch of stuff on every commit and check for a 0 exit status, and if the script fails then git won't let you commit (unless you pass the -n flag as an escape valve but why would you do that all the time?).

so the code is automatically formatted, then typechecked, then the full set of unit tests gets run, then a static code vulnerability analyzer gets run, on every commit. and then lastly, we have a naming convention for all of our working branches to start their names with the unique designation of a task "story" (ugh) in jira. if the working branch is named according to convention, it will extract and format the jira number and prepend it to the beginning of the commit message. if the branch is named something else, you can manually prepend the number yourself, but otherwise it won't let you commit.

the final piece of the puzzle is 2 other custom scripts. the first installs the aforementioned git hooks, and the second checks to see if the hooks are installed and if not, calls the first script. the second script is configured to run before every test run. this is nice because it means a new developer basically never has to think about installing anything, all the checks just happen automatically. and if the hook scripts won't let you commit, they explain the problem in a way that is hopefully helpful and makes sense.

2

twovests wrote

This is some good direction!! I appreciate it. Motivation and taking up the slack on my end (mostly through automation). We're using Jira for our projects too, so it's about time I learn how to use and set up Git hooks :^)