1
0
Fork 0
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:
Alexander Peltzer 2019-11-26 14:04:58 +01:00
parent cb876594a3
commit 9caf9821c9
No known key found for this signature in database
GPG key ID: A4A9322B50AF95A0
2 changed files with 7 additions and 10 deletions

View file

@ -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)

View file

@ -11,7 +11,7 @@
params.custom_config_version = 'master' params.custom_config_version = 'master'
params.custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" params.custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}"
//Please use a new line per includeConfig section to allow easier linting/parsing. Thank you. //Please use a new line per include Config section to allow easier linting/parsing. Thank you.
profiles { profiles {
awsbatch { includeConfig "${params.custom_config_base}/conf/awsbatch.config" } awsbatch { includeConfig "${params.custom_config_base}/conf/awsbatch.config" }
bigpurple { includeConfig "${params.custom_config_base}/conf/bigpurple.config" } bigpurple { includeConfig "${params.custom_config_base}/conf/bigpurple.config" }