Skip to content

Commit

Permalink
Merge pull request #6 from awsdocs/spdx/sap-abap
Browse files Browse the repository at this point in the history
Handle sap-abap SPDX header
  • Loading branch information
DavidSouther authored Feb 27, 2024
2 parents c715183 + 2bdbd41 commit 00c43a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion aws_doc_sdk_examples_tools/spdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ def main():
p = Path(p)
with open(p, encoding="utf8") as f:
contents = f.readlines()
prefix = "#" if p.suffix == ".py" or p.suffix == ".sh" else "//"
prefix = (
"#"
if p.suffix in [".py", ".sh", ".rb"]
else '"'
if p.suffix in [".abap"]
else "//"
)
offset = (
1
if contents[0].startswith("#!")
Expand Down
2 changes: 1 addition & 1 deletion aws_doc_sdk_examples_tools/validator_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def skip(path: Path) -> bool:
".yml",
}

SPDX_LEADER = r"^(#|//) "
SPDX_LEADER = r"^(#|//|\") "
SPDX_COPYRIGHT = r"Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved."
SPDX_LICENSE = r"SPDX-License-Identifier: (Apache-2.0|MIT-0)"

Expand Down

0 comments on commit 00c43a0

Please sign in to comment.