Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Feb 20, 2024
1 parent 208caee commit f04d093
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion semantic-conventions/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pytest==8.0.1
flake8==7.0.0
pylint==3.0.3
isort==5.13.2
requests=2.31.0
requests==2.31.0
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def parse(

tag = attribute.get("tag", "").strip()
stability = SemanticAttribute.parse_stability(
attribute.get("stability"), position_data, not strict_validation
attribute.get("stability"), position_data, strict_validation
)
deprecated = SemanticAttribute.parse_deprecated(
attribute.get("deprecated"), position_data
Expand Down Expand Up @@ -282,7 +282,7 @@ def parse_attribute(attribute):
return attr_type, str(brief), examples

@staticmethod
def parse_stability(stability, position_data, ignore_deprecated=False):
def parse_stability(stability, position_data, strict_validation=True):
if stability is None:
return StabilityLevel.EXPERIMENTAL

Expand All @@ -296,7 +296,7 @@ def parse_stability(stability, position_data, ignore_deprecated=False):

# TODO: remove this branch - it's necessary for now to allow back-compat checks against old spec versions
# where we used 'deprecated' as stability level
if ignore_deprecated and stability == "deprecated":
if not strict_validation and stability == "deprecated":
print(
'WARNING: Using "deprecated" as stability level is no longer supported. Use "experimental" instead.'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __init__(self, group, strict_validation=True):
self.prefix = group.get("prefix", "").strip()
position_data = group.lc.data
self.stability = SemanticAttribute.parse_stability(
group.get("stability"), position_data, not strict_validation
group.get("stability"), position_data, strict_validation
)
self.deprecated = SemanticAttribute.parse_deprecated(
group.get("deprecated"), position_data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
@dataclass()
class MarkdownOptions:
check_only: bool = False
check_compatibility_with: str = None
enable_stable: bool = False
enable_experimental: bool = False
enable_deprecated: bool = True
Expand Down

0 comments on commit f04d093

Please sign in to comment.