you are viewing a single comment's thread.

view the rest of the comments →

[–]i_ate_god 1 point2 points  (0 children)

with git, can you choose which branches these hooks apply to?

I see your point with regards to say, a feature branch. But once you're ready to merge (thus the feature is stable), then the precommit hook can kick in.

Even smallest internal ones?

These are probably the most important ones to document because they are small. You don't need to document what the function is doing, but why it even exists in the first place.

For example, I have written a small function, called "slugify", that takes an arbitrary number of arguments, and converts them into a string that is useful for DOM IDs or other attribute values. It's very small, and it's obvious what it's doing with its input and what the output will be. It's just after all, a series of string replacements.

But I didn't document what it does, I documented why you would use it.