From 71ee9b1f3c6df5564a25b73ca1def6cb97ace6e3 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:20:09 -0400 Subject: [PATCH] Add `bin/lint` utility Add a utility per @fang19911030 request to apply `black` with the same settings that the GitHub action uses. --- bin/lint | 5 +++++ .../gitbook/development/python-guidelines-for-developers.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 bin/lint diff --git a/bin/lint b/bin/lint new file mode 100755 index 000000000..50b31272b --- /dev/null +++ b/bin/lint @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +black --line-length 92 \ + --extend-exclude 'flepimop/gempyor_pkg/src/gempyor/steps_rk4.py' \ + --verbose . diff --git a/documentation/gitbook/development/python-guidelines-for-developers.md b/documentation/gitbook/development/python-guidelines-for-developers.md index b1ca9c239..75a7e60ab 100644 --- a/documentation/gitbook/development/python-guidelines-for-developers.md +++ b/documentation/gitbook/development/python-guidelines-for-developers.md @@ -73,7 +73,7 @@ black --line-length 92 \ --verbose . ``` -For those using a Mac or Linux system for development you can take advantage of the formatting pre-commit hook found at `bin/pre-commit`. To start using it copy this file to your git hooks folder: +For those using a Mac or Linux system for development this command is also available for use by calling `./dev/lint`. Similarly, you can take advantage of the formatting pre-commit hook found at `bin/pre-commit`. To start using it copy this file to your git hooks folder: ```bash cp -f bin/pre-commit .git/hooks/