mirror of
https://github.com/MillironX/nf-configs.git
synced 2024-11-22 00:26:03 +00:00
Use strip
This commit is contained in:
parent
cb876594a3
commit
9caf9821c9
2 changed files with 7 additions and 10 deletions
|
@ -44,28 +44,25 @@ def check_config(Config, Github):
|
||||||
for line in cfg:
|
for line in cfg:
|
||||||
if re.search(regex, line):
|
if re.search(regex, line):
|
||||||
hit = line.split('/')[2].split('.')[0]
|
hit = line.split('/')[2].split('.')[0]
|
||||||
config_profiles.add(hit)
|
config_profiles.add(hit.strip())
|
||||||
|
|
||||||
###Check Github Config now
|
###Check Github Config now
|
||||||
tests = set()
|
tests = set()
|
||||||
with open(Github, 'r') as ghfile:
|
with open(Github, 'r') as ghfile:
|
||||||
for line in ghfile:
|
for line in ghfile:
|
||||||
if re.search('profile: ', line):
|
if re.search('profile: ', line):
|
||||||
line = line.replace('\'','').replace('[','').replace(']','')
|
line = line.replace('\'','').replace('[','').replace(']','').replace('\n','')
|
||||||
profiles = line.split(':')[1].split(',')
|
profiles = line.split(':')[1].split(',')
|
||||||
for p in profiles:
|
for p in profiles:
|
||||||
tests.add(p)
|
tests.add(p.strip())
|
||||||
|
|
||||||
print(len(tests))
|
|
||||||
print(len(config_profiles))
|
|
||||||
|
|
||||||
###Check if sets are equal
|
###Check if sets are equal
|
||||||
if tests == config_profiles:
|
if tests == config_profiles:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
#Maybe report what is missing here too
|
#Maybe report what is missing here too
|
||||||
#print("Tests don't seem to test these profiles properly!\n")
|
print("Tests don't seem to test these profiles properly!\n")
|
||||||
# print(config_profiles.difference(tests))
|
print(config_profiles.symmetric_difference(tests))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
check_config(Config=args.CUSTOM_CONFIG,Github=args.GITHUB_CONFIG)
|
check_config(Config=args.CUSTOM_CONFIG,Github=args.GITHUB_CONFIG)
|
||||||
|
|
Loading…
Reference in a new issue