From ec5b32fb214cd7742d59bceecb400252257500cd Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Tue, 10 Sep 2024 14:24:10 +0200 Subject: [PATCH] Add docs on installing pre-commit in an env We give both the pipx and the venv+pip instructions. Closes #270 --- docs/src/10-full-guide.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/src/10-full-guide.md b/docs/src/10-full-guide.md index 72e2d7d5..42507984 100644 --- a/docs/src/10-full-guide.md +++ b/docs/src/10-full-guide.md @@ -31,19 +31,36 @@ If you decide to gradually adopt, do this: ### Things to install +#### EditorConfig + Install a plugin on your editor to use [EditorConfig](https://editorconfig.org). This will ensure that your editor is configured with important formatting settings. +#### pre-commit + We recommend using [https://pre-commit.com](https://pre-commit.com) to run linters and formatters. If you select the "recommended" options later on, you will need `pre-commit` installed. -To install `pre-commit`, we recommend using [pipx](https://pipx.pypa.io) as follows: -```bash -# Install pipx following the link -pipx install pre-commit -``` +`pre-commit` is a python package, so there are a few ways to install. +We like one of these two ways: + +1. Using [pipx](https://pipx.pypa.io) as follows: + + ```bash + pipx install pre-commit + ``` + +2. Using `pip` in a virtual environment + + ```bash + python -m venv env + source env/bin/activate + pip install pre-commit + ``` + +#### JuliaFormatter -In particular, the Julia code is formatted using [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl), so please install it globally first: +When using `pre-commit`, the Julia code is formatted using [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl), so please install it globally first: ```julia-repl julia> # Press ]