top | item 41611433

(no title)

renlo | 1 year ago

Agree that the repository/service pattern is a good way to adhere to separation of concerns and make refactoring and readability easier.

That said, I really disagree with any precommit checks. Committing code should be thought of as just saving the code, checks should be run before merging code not saving code. It'd be like Clippy preventing you from saving a Word document because you have a spelling error. It's a frustrating experience.

I can make sure my code is good before I submit it for review, not when I'm just trying to make sure my work has been saved so I can continue working on it later (commit).

discuss

order

Foreignborn|1 year ago

Most pre-commits I’ve seen are usually formatting/prettier.

But if need be, I will spam my commits locally with `—no-verify`. Once the code is ready, I reset to head and remake them as nice, conventional commits.

Degorath|1 year ago

While I like abstracting storage into a repository class of sorts, this crap of "userService" needs to die already. I've seen too many bad codebases that stick everything user related into that one service that ends up having 8+ completely noncohesive functions.

BeetleB|1 year ago

Usually you have those checks when pushing, not committing.