From 8bc83b2d483c3ec3e16ceace2741aad0b8ac4715 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Wed, 16 Dec 2020 20:01:46 +0200 Subject: [PATCH] docs: Add lint_clean_files instructions --- docs/contributing.rst | 2 +- docs/development.rst | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index ba034b1f..0f0d1299 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -39,7 +39,7 @@ Code Style * When adding new files, be sure to add them into `clean_files.txt`, which is a growing list of linted files in the project. -* When changing existing files, consider also adding them into `clean_files.txt` and fixing the linting errors that arise. +* When changing existing files, consider also adding them into `clean_files.txt` and fixing the linting errors that arise. See :ref:`linting_your_changes` for more information. * Indentation is using tabs, not spaces. Most of the code is indented with 2 spaces, some with 4 spaced tabs. Please try to stick to tabs. If you're using an editor that supports `EditorConfig `_\ , the editor should automatically use the settings defined in Bash-it's `.editorconfig file <.editorconfig>`_. * When creating new functions, please use a dash ("-") to separate the words of the function's name, e.g. ``my-new-function``. diff --git a/docs/development.rst b/docs/development.rst index 924d189b..b49ff141 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -92,3 +92,21 @@ This file configures the behavior of the a pre-commit hook based on `the Pre-Com installing it (with pip, brew or other tools) then run ``pre-commit install`` in the repo's root to activate the hook. For the full use of the tool, you may need to install also other third-party tools, such as `shellcheck `_ and `shfmt `_. + + +.. _linting_your_changes: + +Linting Your Changes +-------------------- + +In order to properly lint your changes, you should use our linting script, +by simply running ``./lint_clean_files.sh``. This script iterates over all marked-as-clean +files, and runs the pre-commit hook on them. + +Please note that most of the files in the project are currently not linted, +as we want to make the linting process easier. +In order to add your changed/added files to the linting process, +please add your files to ``clean_files.txt``. This way ``lint_clean_files.sh`` +will know to pick them up and lint them. + +Thank you for helping clean up Bash-it, and making it a nicer and better project |:heart:|