From 1a166462a52f09d706e9fa3ba489197cd42aa58a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 21 Jan 2021 08:42:39 +0100 Subject: [PATCH] Indicate feature toggle optional fields This helps get the code annotations linter pass on edx-platform. --- code_annotations/base.py | 10 +++++++--- .../contrib/config/feature_toggle_annotations.yaml | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/code_annotations/base.py b/code_annotations/base.py index deaf637..8d5b290 100644 --- a/code_annotations/base.py +++ b/code_annotations/base.py @@ -445,8 +445,10 @@ def check_results(self, all_results): def iter_groups(self, annotations): """ - Iterate on groups of annotations. Annotations are considered as a group when they all have the same - `line_number`, which should point to the beginning of the annotation group. + Iterate on groups of annotations. + + Annotations are considered as a group when they all have the same `line_number`, which should point to the + beginning of the annotation group. Yield: annotations (annotation list) @@ -468,7 +470,9 @@ def iter_groups(self, annotations): def check_group(self, annotations): """ - Perform several linting checks on a group of annotations: + Perform several linting checks on a group of annotations. + + The following checks are performed: - Choice fields should have a valid value - Annotation tokens are valid diff --git a/code_annotations/contrib/config/feature_toggle_annotations.yaml b/code_annotations/contrib/config/feature_toggle_annotations.yaml index 7af422e..a937d47 100644 --- a/code_annotations/contrib/config/feature_toggle_annotations.yaml +++ b/code_annotations/contrib/config/feature_toggle_annotations.yaml @@ -16,8 +16,11 @@ annotations: choices: [temporary, circuit_breaker, vip, opt_out, opt_in, open_edx] - ".. toggle_creation_date:": - ".. toggle_target_removal_date:": + optional: true - ".. toggle_warnings:": + optional: true - ".. toggle_tickets:": + optional: true extensions: python: - py