From 09e0b8affccfa4805e4f3130e0712a65ec1f2158 Mon Sep 17 00:00:00 2001 From: "Sam Lieber (sali)" Date: Fri, 10 Nov 2023 12:32:40 -0500 Subject: [PATCH] [IMP] tests: make review UX and resource files closes odoo/documentation#6434 X-original-commit: 25e204adcdb2519d23be6e2ed2e25640bfd0f341 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Samuel Lieber (sali) Co-authored-by: Antoine Vandevenne (anv) --- Makefile | 5 +++-- tests/main.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9fc7c2499..28b5d2114 100644 --- a/Makefile +++ b/Makefile @@ -86,12 +86,13 @@ static: $(HTML_BUILD_DIR)/_static/style.css # Called by runbot for the ci/documentation_guideline check. test: - @python tests/main.py $(SOURCE_DIR)/administration $(SOURCE_DIR)/applications $(SOURCE_DIR)/contributing $(SOURCE_DIR)/developer $(SOURCE_DIR)/services redirects + @python tests/main.py $(SOURCE_DIR)/administration $(SOURCE_DIR)/applications $(SOURCE_DIR)/contributing $(SOURCE_DIR)/developer redirects # Similar as `test`, but called only manually by content reviewers to trigger extra checks. review: - @read -p "Enter content path: " path; read -p "Enter max line length (default: 100): " line_length; \ + @read -p "Enter relative content path: " path; read -p "Enter max line length (default: 100): " line_length; \ if [ -z "$$path" ]; then echo "Error: Path cannot be empty"; exit 1; fi; \ + if echo $$path | grep -q 'content/'; then path=`echo $$path | sed 's|content/||'`; fi; \ if [ -z "$$line_length" ]; then line_length=100; fi; \ export REVIEW=1; \ python tests/main.py --max-line-length=$$line_length $(SOURCE_DIR)/$$path diff --git a/tests/main.py b/tests/main.py index 778c35be3..8d7de7760 100644 --- a/tests/main.py +++ b/tests/main.py @@ -89,4 +89,5 @@ if __name__ == '__main__': setattr(sphinxlint.check_line_too_long, 'enabled', True) setattr(checkers.rst_style.check_early_line_breaks, 'enabled', True) ADDITIONAL_CHECKERS.extend([checkers.resource_files.check_image_color_depth]) + run_additional_checks() sys.exit(sphinxlint.main())