Skip to content

Commit

Permalink
style: Clean up groovy formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Sep 13, 2024
1 parent cdb487e commit 46c516c
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions tests/lib/UTILS.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Function to remove Nextflow version from pipeline_software_mqc_versions.yml

class UTILS {
// Function to remove Nextflow version from pipeline_software_mqc_versions.yml
public static String removeNextflowVersion(pipeline_software_mqc_versions) {
def softwareVersions = path(pipeline_software_mqc_versions).yaml
if (softwareVersions.containsKey("Workflow")) {
Expand All @@ -9,37 +8,36 @@ class UTILS {
return softwareVersions
}

// Recursively list all files in a directory and its sub-directories, matching a given suffix
// TODO: use regex pattern instead of suffix?
public static getAllFilesFromDir(dir, suffix) {
def output = []
new File(dir).eachFileRecurse() {
if (it.name.toString().endsWith(suffix)) {
output.add(it)
// Recursively list all files in a directory and its sub-directories, matching a given suffix
// TODO: use regex pattern instead of suffix?
public static getAllFilesFromDir(dir, suffix) {
def output = []
new File(dir).eachFileRecurse() {
if (it.name.toString().endsWith(suffix)) {
output.add(it)
}
}
return output.sort()
}
return output.sort()
}
// Recursively list all files names in a directory and its sub-directories, matching a given suffix, return file names
public static getAllFileNamesFromDir(dir, suffix) {
def output = []
new File(dir).eachFileRecurse() {
if (it.name.toString().endsWith(suffix)) {
output.add(it.toString().split("/")[-1])
// Recursively list all files names in a directory and its sub-directories, matching a given suffix, return file names
public static getAllFileNamesFromDir(dir, suffix) {
def output = []
new File(dir).eachFileRecurse() {
if (it.name.toString().endsWith(suffix)) {
output.add(it.toString().split("/")[-1])
}
}
return output.sort()
}
return output.sort()
}

// Recursively list all files names in a directory and its sub-directories, matching a given suffix, return if check if given string is in file
public static checkAllFilesNamesFromDirForString(dir, suffix, string) {
def output = []
new File(dir).eachFileRecurse() {
if (it.name.toString().endsWith(suffix)) {
output.add(it.text.contains(string))
// Recursively list all files names in a directory and its sub-directories, matching a given suffix, return if check if given string is in file
public static checkAllFilesNamesFromDirForString(dir, suffix, string) {
def output = []
new File(dir).eachFileRecurse() {
if (it.name.toString().endsWith(suffix)) {
output.add(it.text.contains(string))
}
}
return output.sort()
}
return output.sort()
}

}

0 comments on commit 46c516c

Please sign in to comment.