From 10f2a02bb805635f0fd5549a437f461d4545adf5 Mon Sep 17 00:00:00 2001 From: shatakshiiii Date: Thu, 14 Dec 2023 13:11:03 +0530 Subject: [PATCH] Add a tox.ini example in content-best-practices --- .config/dictionary.txt | 1 + docs/user-guide/content-best-practices.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.config/dictionary.txt b/.config/dictionary.txt index 7a99178f..87c65da8 100644 --- a/.config/dictionary.txt +++ b/.config/dictionary.txt @@ -1,2 +1,3 @@ devel libera +testenv diff --git a/docs/user-guide/content-best-practices.md b/docs/user-guide/content-best-practices.md index d80b5dfa..0dda9d73 100644 --- a/docs/user-guide/content-best-practices.md +++ b/docs/user-guide/content-best-practices.md @@ -7,6 +7,20 @@ Integrating lint into your Continuous Integration (CI) pipeline ensures that you To add Tox Entry for Linting: 1. Create a `tox.ini` file in the root directory of your project. This file will contain the configuration for running various environments. + +```ini +# tox.ini +[tox] +env_list = lint + +[testenv:lint] +deps = + pre-commit + # Add other linters as needed +commands = + pre-commit run --show-diff-on-failure --all-files +``` + 2. Update your CI configuration file (for example `.github/workflows/main.yml` for GitHub Actions) to include the tox command with the linting environment. 3. Commit the changes to your repository and push them, to trigger the CI pipeline.