golem icon indicating copy to clipboard operation
golem copied to clipboard

As a Dev, I would to implement pre-commit Hooks for Code Quality and Consistency

Open ArthurData opened this issue 1 year ago • 1 comments

User - Validation

  • [ ] grkstyle' style is apply at each commit

Dev - Tech

Using pre-commit in the golem package ensures high code quality and consistency. Pre-commit automates code checks before each commit, catching errors early and enforcing coding standards.

Benefits of pre-commit with golem:

  • Code Quality: Prevents bugs and inconsistencies by running tests and lints automatically.
  • Productivity: Automates repetitive checks, allowing developers to focus on complex tasks.
  • Consistency: Ensures uniform code style across all contributors.
  • Continuous Integration: Integrates smoothly with CI/CD systems, enforcing standards before merging.

Before to commit, we can:

  • Apply grkstyle,
  • Check for browser()

Estimated time

01h00.

ArthurData avatar Jul 17 '24 15:07 ArthurData

Current thoughts:

  • For golem developers => using precommit as is, required Python but that's ok
  • For golem users:
    • new package called {golem.lint} with
      • golem_style()
      • sanity_check()
      • with_golem_precommit()
        • install precommit()
        • Check for precommit config
        • create a default precommit yaml with hooks from default precommit lib, from the R package, and from {golemlint}

ColinFay avatar Aug 02 '24 08:08 ColinFay