From 7051bd055ab1f55c0ad2c74e9a18dde3a2fd7662 Mon Sep 17 00:00:00 2001 From: Ayan Sinha Mahapatra Date: Wed, 23 Oct 2019 02:49:07 +0530 Subject: [PATCH 1/3] Add doc8 style checks to Travis-CI Signed-off-by: Ayan Sinha Mahapatra --- .travis.yml | 4 +++- docs/scripts/doc8_style_check.sh | 5 +++++ docs/source/scancode-toolkit/contribute/contrib_doc.rst | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 docs/scripts/doc8_style_check.sh diff --git a/.travis.yml b/.travis.yml index c9d87282..2d1225ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,14 @@ language: python python: - '3.6' install: -- pip install Sphinx sphinx_rtd_theme +- pip install Sphinx sphinx_rtd_theme doc8 before_install: - chmod +x ./docs/scripts/sphinx_build_link_check.sh +- chmod +x ./docs/scripts/doc8_style_check.sh script: - cd docs - "./scripts/sphinx_build_link_check.sh" +- "./scripts/doc8_style_check.sh" notifications: slack: secure: i2YByZfJB5RDtM+51eR3Bs2C8Sj00pljlllpZdMsbap/2uKepN+2qvuU+xhkfU64+sSqwE/VgknCO1v7SdB9PmtuZX+7LFUnWzoCSLLsqoDBFROTCb/siTR5OhxEMOWhKTXjsNsAb0jsx+fbfhohUdh5xDHxKxloAqa07Sg3W083yyd02VRAlsyw5a0iJo0Xq35z/FSsPH7y2rIVTQjj15M24qoQS9R4mqIF/HLGO21p527T0w+U7sZegCMayBgc0+fW8b/IbzfPWHNQ6pKv/zTIGQUDTkxmxdVOVokJ6KWVnLTgRjMNv3/mV6t/8r8HYuO9i9le3jVFX7BE7jxS1kQATR27UjKj1p3IA6xRIggxeH8apq22/GpCoCJZzlA/LRWX06IMhFu9MzB2OQeI2opn7FekIINjJIcmwL8Azsws14xD84H8rdbBD23kCWlzq/38u9wdHitLv7lEHAvdLlZbJAoF9vb1Ui0m5OylhQ4auW3ZqiXKfYshgdcLmMStQGiIsDvB4RORBDTHAig+XbBzP3YuAvQE/JvrJO7C7392rSqkZgClIs5a0+ZqJdvLcX3F8+WXkqFoQ7vQ01STTzhGBxA/deizvk7MvX4uMY2T4xxU6OPai1px608q34pDiuEchBpasU1sHJagO8rrWOEfjlbT7RuS7t5PIhwR648= diff --git a/docs/scripts/doc8_style_check.sh b/docs/scripts/doc8_style_check.sh new file mode 100755 index 00000000..f0d619d6 --- /dev/null +++ b/docs/scripts/doc8_style_check.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# halt script on error +set -e +# Check for Style Code Violations +doc8 --max-line-length 100 source/scancode-toolkit --ignore D000 --quiet \ No newline at end of file diff --git a/docs/source/scancode-toolkit/contribute/contrib_doc.rst b/docs/source/scancode-toolkit/contribute/contrib_doc.rst index 0c705c3a..0aa75e90 100644 --- a/docs/source/scancode-toolkit/contribute/contrib_doc.rst +++ b/docs/source/scancode-toolkit/contribute/contrib_doc.rst @@ -22,7 +22,7 @@ How To Run Style Tests In the project root, run the following command:: - $ doc8 --max-line-length 100 docs/source/scancode-toolkit + $ doc8 --max-line-length 100 docs/source/scancode-toolkit --ignore D000 .. note:: From 5431f7cdc139d5bc8f2989c50ad2d0149dc9ce20 Mon Sep 17 00:00:00 2001 From: Ayan Sinha Mahapatra Date: Fri, 25 Oct 2019 01:30:29 +0530 Subject: [PATCH 2/3] Add comments on Doc8 Style Guides Signed-off-by: Ayan Sinha Mahapatra --- docs/scripts/doc8_style_check.sh | 4 ++++ docs/source/doc_maintenance.rst | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/docs/scripts/doc8_style_check.sh b/docs/scripts/doc8_style_check.sh index f0d619d6..9399e86b 100755 --- a/docs/scripts/doc8_style_check.sh +++ b/docs/scripts/doc8_style_check.sh @@ -2,4 +2,8 @@ # halt script on error set -e # Check for Style Code Violations +# (Here D000 is ignored to bypass the include statement errors as the files we are including are +# not in the same source folder as the include statement.) +# [ToDo 1. Expand Scan to All Docs (source/) 2. Fix this D000 workaround if possible] +# Doc Contribution Guide is at scancode-toolkit/contribute/contrib_doc.rst doc8 --max-line-length 100 source/scancode-toolkit --ignore D000 --quiet \ No newline at end of file diff --git a/docs/source/doc_maintenance.rst b/docs/source/doc_maintenance.rst index 49d9dc89..d60fcab3 100644 --- a/docs/source/doc_maintenance.rst +++ b/docs/source/doc_maintenance.rst @@ -101,3 +101,9 @@ examples:: The AboutCode webhook with ReadTheDocs should rebuild the documentation. You can review your results online. + +Documentation Style Guides +-------------------------- + +The ``scancode-toolkit`` documentation is compliant to our doc style standards, enforced using +``doc8``. For more details refer :ref:`contrib_doc_dev`. From cf71274e700d5a96568b174a489316c488265b75 Mon Sep 17 00:00:00 2001 From: Ayan Sinha Mahapatra Date: Sat, 26 Oct 2019 03:52:24 +0530 Subject: [PATCH 3/3] Add doc8 style checks for all docs Signed-off-by: Ayan Sinha Mahapatra --- docs/scripts/doc8_style_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scripts/doc8_style_check.sh b/docs/scripts/doc8_style_check.sh index 9399e86b..91d7fb0b 100755 --- a/docs/scripts/doc8_style_check.sh +++ b/docs/scripts/doc8_style_check.sh @@ -6,4 +6,4 @@ set -e # not in the same source folder as the include statement.) # [ToDo 1. Expand Scan to All Docs (source/) 2. Fix this D000 workaround if possible] # Doc Contribution Guide is at scancode-toolkit/contribute/contrib_doc.rst -doc8 --max-line-length 100 source/scancode-toolkit --ignore D000 --quiet \ No newline at end of file +doc8 --max-line-length 100 source/ --ignore D000 --quiet \ No newline at end of file