mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ci: kconfig rules: Allow any file starting with KConfig.* to be sourced
This commit is contained in:
parent
278c2f1aea
commit
f8b1ef1b14
@ -94,11 +94,12 @@ class SourceChecker(BaseChecker):
|
||||
raise InputError(self.path_in_idf, line_number, '"source" has to been followed by space',
|
||||
line.replace('source', 'source '))
|
||||
path = m.group(2)
|
||||
filename = os.path.basename(path)
|
||||
if path in ['$COMPONENT_KCONFIGS_PROJBUILD', '$COMPONENT_KCONFIGS']:
|
||||
pass
|
||||
elif not path.endswith('/Kconfig.in') and path != 'Kconfig.in':
|
||||
raise InputError(self.path_in_idf, line_number, "only Kconfig.in can be sourced",
|
||||
line.replace(path, os.path.join(os.path.dirname(path), 'Kconfig.in')))
|
||||
elif not filename.startswith('Kconfig.'):
|
||||
raise InputError(self.path_in_idf, line_number, "only filenames starting with Kconfig.* can be sourced",
|
||||
line.replace(path, os.path.join(os.path.dirname(path), 'Kconfig.' + filename)))
|
||||
|
||||
|
||||
class LineRuleChecker(BaseChecker):
|
||||
|
@ -80,10 +80,10 @@ class TestSourceChecker(unittest.TestCase, ApplyLine):
|
||||
pass
|
||||
|
||||
def test_source_file_name(self):
|
||||
self.expect_error('source "Kconfig.test"', expect='source "Kconfig.in"')
|
||||
self.expect_error('source "/tmp/Kconfig.test"', expect='source "/tmp/Kconfig.in"')
|
||||
self.expect_error('source "Kconfig"', expect='source "Kconfig.in"')
|
||||
self.expect_error('source "notKconfig.test"', expect='source "Kconfig.notKconfig.test"')
|
||||
self.expect_error('source "Kconfig"', expect='source "Kconfig.Kconfig"')
|
||||
self.expt_success('source "Kconfig.in"')
|
||||
self.expt_success('source "/tmp/Kconfig.test"')
|
||||
self.expt_success('source "/tmp/Kconfig.in"')
|
||||
self.expect_error('source"Kconfig.in"', expect='source "Kconfig.in"')
|
||||
self.expt_success('source "/tmp/Kconfig.in" # comment')
|
||||
|
Loading…
Reference in New Issue
Block a user