fixed license

This commit is contained in:
dashevchenko 2023-10-05 20:31:51 +03:00
parent 4c00b839e6
commit 8cce30b438
2 changed files with 61 additions and 28 deletions

View File

@ -1,3 +1,19 @@
#
# Copyright © 2016-2023 The Thingsboard Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: check_yml_file
on:
pull_request:

View File

@ -1,3 +1,19 @@
#
# Copyright © 2016-2023 The Thingsboard Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import sys
import re
@ -18,15 +34,16 @@ def parse_line(table_name, comment, key_level_map, parent_line_level, index, lin
return
line = lines[index]
line_level = (len(line) - len(line.lstrip())) if line.strip() else 0
if line_level == 0:
key_level_map = {0 : ''}
line = line.strip()
# if line is empty - parse next line
if not line:
index = index + 1
parse_line(table_name, comment, key_level_map, line_level, index, lines, properties)
# if line is a comment - save comment and parse next line
elif line.startswith('#'):
else:
if line_level == 0:
key_level_map = {0 : ''}
if line.startswith('#'):
if line_level == 0:
table_name = line.lstrip('#')
elif line_level == parent_line_level: