Skip to content

Commit

Permalink
add rule link (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllyW authored Jul 7, 2023
1 parent 09c5984 commit 7468050
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion azdev/operations/command_change/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class DiffExportFormat(Enum):

class MetaChangeDetects:

EXPORTED_META_PROPERTY = ["rule_id", "is_break", "rule_message", "suggest_message", "cmd_name", "subgroup_name"]
EXPORTED_META_PROPERTY = ["rule_id", "rule_link_url", "is_break", "rule_message", "suggest_message",
"cmd_name", "subgroup_name"]
CHECKED_PARA_PROPERTY = ["name", "options", "required", "choices", "id_part", "nargs", "default", "desc",
"aaz_type", "type", "aaz_default", "aaz_choices"]

Expand Down
4 changes: 3 additions & 1 deletion azdev/operations/command_change/meta_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
# license information.
# -----------------------------------------------------------------------------

from azdev.utilities import get_change_rule_template, get_change_suggest_template
from azdev.utilities import get_change_rule_template, get_change_suggest_template, \
BREAKING_CHANE_RULE_LINK_URL_PREFIX, BREAKING_CHANE_RULE_LINK_URL_SUFFIX


class MetaChange:

def __init__(self, rule_id="1000", is_break=False, rule_message="", suggest_message=""):
self.rule_id = rule_id
self.rule_link_url = BREAKING_CHANE_RULE_LINK_URL_PREFIX + self.rule_id + BREAKING_CHANE_RULE_LINK_URL_SUFFIX
self.is_break = is_break
self.rule_message = rule_message
self.suggest_message = suggest_message
Expand Down
4 changes: 4 additions & 0 deletions azdev/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
CommandError
)
from .const import (
BREAKING_CHANE_RULE_LINK_URL_PREFIX,
BREAKING_CHANE_RULE_LINK_URL_SUFFIX,
CMD_PROPERTY_ADD_BREAK_LIST,
CMD_PROPERTY_REMOVE_BREAK_LIST,
CMD_PROPERTY_UPDATE_BREAK_LIST,
Expand Down Expand Up @@ -67,6 +69,8 @@
__all__ = [
'COMMAND_MODULE_PREFIX',
'EXTENSION_PREFIX',
'BREAKING_CHANE_RULE_LINK_URL_PREFIX',
'BREAKING_CHANE_RULE_LINK_URL_SUFFIX',
'CMD_PROPERTY_ADD_BREAK_LIST',
'CMD_PROPERTY_REMOVE_BREAK_LIST',
'CMD_PROPERTY_UPDATE_BREAK_LIST',
Expand Down
3 changes: 3 additions & 0 deletions azdev/utilities/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
ENV_VAR_VIRTUAL_ENV = ['VIRTUAL_ENV', 'CONDA_PREFIX'] # used by system to identify virtual environment
ENV_VAR_TEST_LIVE = 'AZURE_TEST_RUN_LIVE' # denotes that tests should be run live instead of played back

BREAKING_CHANE_RULE_LINK_URL_PREFIX = "https://github.com/Azure/azure-cli/blob/dev/doc/breaking_change_rules/"
BREAKING_CHANE_RULE_LINK_URL_SUFFIX = ".md"

CMD_PROPERTY_REMOVE_BREAK_LIST = []
CMD_PROPERTY_ADD_BREAK_LIST = ["confirmation"]
CMD_PROPERTY_UPDATE_BREAK_LIST = []
Expand Down

0 comments on commit 7468050

Please sign in to comment.