Skip to content

Install ruff & pre-commit #118

@rburghol

Description

@rburghol

OVerview

  • This gets installed in your system, then you can activate it in any repo that has a file named .pre-commit-config.yaml
  • Make your changes, --add them, and then when you execute commit, the pre-commit system will:
    • run, applying the ruff (and other) settings onto your code
    • If there are changes, it will make those changes to your code.
    • If you like those changes, you must execute another git commit to accept them. (If not, use git
  • Note: Since this installs using pip in the virtual env, the virtual env must be activated when ruff'ing code
source /usr/local/share/venv/hsp2dev_py10/bin/activate
python3 -m pip install ruff
# Install pre-commit
# Note: in the root of the repo file ".pre-commit-config.yaml" which outlines the fixes on commit
pip install pre-commit

# Note: to ACTIVATE pre-commit in a repo, you must cd to the repo and install:
cd /opt/model/HSPsquared
pre-commit install-hooks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions