From 041cf6dba9db3294bfe47529a94cf62466b665fa Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:33:19 -0800 Subject: [PATCH] lint --- .github/workflows/mega-linter.yml | 4 +- .github/workflows/test.yml | 79 +++++++------ .gitignore | 1 + .groovylintrc.json | 180 +++++++++++++++--------------- .vscode/settings.json | 6 +- CHANGELOG.md | 15 ++- README-DEV.md | 14 ++- README.md | 56 +++++----- 8 files changed, 181 insertions(+), 174 deletions(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index f24067b7..be248a1b 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -17,7 +17,7 @@ env: # Comment env block if you do not want to apply fixes #APPLY_FIXES_MODE: pull_request # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) DISABLE_LINTERS: SPELL_CSPELL,COPYPASTE_JSCPD,REPOSITORY_GITLEAKS,GROOVY_NPM_GROOVY_LINT FILTER_REGEX_EXCLUDE: .*/.*gradle - + concurrency: group: ${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true @@ -31,7 +31,7 @@ jobs: - name: Checkout Code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: - token: ${{ secrets.GITHUB_TOKEN }} # secrets.PAT || + token: ${{ secrets.GITHUB_TOKEN }} # secrets.PAT || fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances # MegaLinter diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e60e793..496e8055 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,49 +25,48 @@ jobs: runs-on: ${{ matrix.os }} steps: - # Git Checkout - - name: Checkout Code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 + # Git Checkout + - name: Checkout Code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::712023778557:role/github/GitHub-Testing-NF-Quilt - aws-region: us-east-1 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::712023778557:role/github/GitHub-Testing-NF-Quilt + aws-region: us-east-1 - - name: Setup Java ${{matrix.java_version}} - uses: actions/setup-java@v4 - with: - java-version: ${{matrix.java_version}} - distribution: 'temurin' - architecture: x64 - cache: gradle - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + - name: Setup Java ${{matrix.java_version}} + uses: actions/setup-java@v4 + with: + java-version: ${{matrix.java_version}} + distribution: "temurin" + architecture: x64 + cache: gradle - - name: Run Gradle Tests - run: make test - env: - LOG4J_DEBUG: true + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - - name: Archive production artifacts (Windows only) - uses: actions/upload-artifact@v4 - if: ${{ always() && matrix.os == 'windows-latest' }} - with: - name: nf-quilt-test-reports-${{ matrix.os }}-${{ matrix.java_version }} - path: | + - name: Run Gradle Tests + run: make test + env: + LOG4J_DEBUG: true + + - name: Archive production artifacts (Windows only) + uses: actions/upload-artifact@v4 + if: ${{ always() && matrix.os == 'windows-latest' }} + with: + name: nf-quilt-test-reports-${{ matrix.os }}-${{ matrix.java_version }} + path: | D:\a\nf-quilt\nf-quilt\plugins\nf-quilt\build\reports\ - overwrite: true - - name: Archive production artifacts (Linux and MacOS) - uses: actions/upload-artifact@v4 - if: ${{ always() && matrix.os != 'windows-latest' }} - with: - name: nf-quilt-test-reports-${{ matrix.os }}-${{ matrix.java_version }} - path: | + overwrite: true + - name: Archive production artifacts (Linux and MacOS) + uses: actions/upload-artifact@v4 + if: ${{ always() && matrix.os != 'windows-latest' }} + with: + name: nf-quilt-test-reports-${{ matrix.os }}-${{ matrix.java_version }} + path: | ${{ github.workspace }}/plugins/nf-quilt/build/reports/ - overwrite: true - + overwrite: true diff --git a/.gitignore b/.gitignore index b19120d5..ea9f81ed 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ params.yaml null # quilt+* # nextflow +.aider* diff --git a/.groovylintrc.json b/.groovylintrc.json index 536acf30..e4b536a6 100644 --- a/.groovylintrc.json +++ b/.groovylintrc.json @@ -1,92 +1,92 @@ { - "extends": "recommended", - "rules": { - "CatchException": { - "enabled": false - }, - "CatchThrowable": { - "enabled": false - }, - "ClassJavadoc": { - "enabled": false - }, - "ClosureAsLastMethodParameter": { - "enabled": false - }, - "DuplicateNumberLiteral": { - "enabled": false - }, - "DuplicateStringLiteral": { - "enabled": false - }, - "FieldTypeRequired": { - "enabled": false - }, - "ImplicitClosureParameter": { - "enabled": false - }, - "JUnitPublicNonTestMethod": { - "enabled": false - }, - "JUnitTestMethodWithoutAssert": { - "enabled": false - }, - "JavaIoPackageAccess": { - "enabled": false - }, - "JavadocEmptyFirstLine": { - "enabled": false - }, - "JavadocEmptyReturnTag": { - "enabled": false - }, - "JavadocMissingParamDescription": { - "enabled": false - }, - "JavadocMissingThrowsDescription": { - "enabled": false - }, - "MethodCount": { - "enabled": false - }, - "MethodParameterTypeRequired": { - "enabled": false - }, - "MethodSize": { - "enabled": false - }, - "NoDef": { - "enabled": false - }, - "PrintStackTrace": { - "enabled": false - }, - "PropertyName": { - "enabled": false - }, - "SpaceAroundMapEntryColon": { - "enabled": false - }, - "SpaceAroundOperator": { - "enabled": false - }, - "SystemExit": { - "enabled": false - }, - "UnnecessaryGetter": { - "enabled": false - }, - "UnnecessaryObjectReferences": { - "enabled": false - }, - "UnnecessarySetter": { - "enabled": false - }, - "VariableName": { - "enabled": false - }, - "VariableTypeRequired": { - "enabled": false - } + "extends": "recommended", + "rules": { + "CatchException": { + "enabled": false + }, + "CatchThrowable": { + "enabled": false + }, + "ClassJavadoc": { + "enabled": false + }, + "ClosureAsLastMethodParameter": { + "enabled": false + }, + "DuplicateNumberLiteral": { + "enabled": false + }, + "DuplicateStringLiteral": { + "enabled": false + }, + "FieldTypeRequired": { + "enabled": false + }, + "ImplicitClosureParameter": { + "enabled": false + }, + "JUnitPublicNonTestMethod": { + "enabled": false + }, + "JUnitTestMethodWithoutAssert": { + "enabled": false + }, + "JavaIoPackageAccess": { + "enabled": false + }, + "JavadocEmptyFirstLine": { + "enabled": false + }, + "JavadocEmptyReturnTag": { + "enabled": false + }, + "JavadocMissingParamDescription": { + "enabled": false + }, + "JavadocMissingThrowsDescription": { + "enabled": false + }, + "MethodCount": { + "enabled": false + }, + "MethodParameterTypeRequired": { + "enabled": false + }, + "MethodSize": { + "enabled": false + }, + "NoDef": { + "enabled": false + }, + "PrintStackTrace": { + "enabled": false + }, + "PropertyName": { + "enabled": false + }, + "SpaceAroundMapEntryColon": { + "enabled": false + }, + "SpaceAroundOperator": { + "enabled": false + }, + "SystemExit": { + "enabled": false + }, + "UnnecessaryGetter": { + "enabled": false + }, + "UnnecessaryObjectReferences": { + "enabled": false + }, + "UnnecessarySetter": { + "enabled": false + }, + "VariableName": { + "enabled": false + }, + "VariableTypeRequired": { + "enabled": false } -} \ No newline at end of file + } +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 78b61df5..75441df0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { - "java.compile.nullAnalysis.mode": "disabled", - "java.configuration.updateBuildConfiguration": "disabled" -} \ No newline at end of file + "java.compile.nullAnalysis.mode": "disabled", + "java.configuration.updateBuildConfiguration": "disabled" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 16870586..2bcf6393 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ ## [0.8.11] 2024-11-5 UNPUBLISHED -- Catch *all* toJson errors +- Catch _all_ toJson errors ## [0.8.10] 2024-11-4 UNPUBLISHED @@ -34,8 +34,8 @@ ## [0.8.7] 2024-10-23 UNPUBLISHED -- Use package cache instead of `params` to find output URIs - (in order to support dynamic URIs set by, e.g. `main.nf`) +- Use package cache instead of `params` to find output URIs (in order to support + dynamic URIs set by, e.g. `main.nf`) - Allow setting metadata from inside the workflow ## [0.8.6] 2024-09-11 @@ -59,7 +59,8 @@ ## [0.8.2] 2024-09-07 -- Use copyFile rather than writeString for overlay files [requires NextFlow 23 or later] +- Use copyFile rather than writeString for overlay files [requires NextFlow 23 + or later] - Restore README and quilt_summarize to output ## [0.8.1] 2024-09-05 @@ -205,7 +206,8 @@ Beta release (not yet on nextflow-io/plugins) - Use `msg` fragment parameter as commit message when writing packages - Removed Benchling support (will add back in a future release) -- Don't crash when writing to Quilt+ URIs with `&path=` fragments (by ignoring that part) +- Don't crash when writing to Quilt+ URIs with `&path=` fragments (by ignoring + that part) ## [0.3.5] 2023-04-05 @@ -226,5 +228,6 @@ Beta release (not yet on nextflow-io/plugins) ## [0.3.2] 2023-02-24 -- First official release on [nextflow-io/plugins](https://github.com/nextflow-io/plugins/commits/main/plugins.json) +- First official release on + [nextflow-io/plugins](https://github.com/nextflow-io/plugins/commits/main/plugins.json) - Read and write from Quilt+ URIs diff --git a/README-DEV.md b/README-DEV.md index 33058904..5ccf2969 100644 --- a/README-DEV.md +++ b/README-DEV.md @@ -2,10 +2,14 @@ ## Using Pre-Release Versions -Occasionally we will release beta versions of the plugin that are not yet available in the Nextflow plugin registry. You can help test these versions as follows: +Occasionally we will release beta versions of the plugin that are not yet +available in the Nextflow plugin registry. You can help test these versions as +follows: -- Set the `NXF_PLUGINS_TEST_REPOSITORY` environment variable to the URL of the plugin's metadata file -- Specify the plugin version in the `plugins` section of your `nextflow.config` file +- Set the `NXF_PLUGINS_TEST_REPOSITORY` environment variable to the URL of the + plugin's metadata file +- Specify the plugin version in the `plugins` section of your `nextflow.config` + file From the command-line, do, e.g.: @@ -51,7 +55,7 @@ To quickly run `nf-quilt` from this GitHub repository: # install and compiles dependencies, then test make test-all # create "test/hurdat" package on s3://$WRITE_BUCKET -make pkg-test WRITE_BUCKET=your-writeablebucket +make pkg-test WRITE_BUCKET=your-writeablebucket ``` This ensures you have properly installed Nextflow and configured your local @@ -77,7 +81,7 @@ file (be sure to rename the `outdir` parameter if you use different convention). For example: ```bash - ./launch.sh run ./main.nf -profile standard -plugins $(PROJECT) --outdir "quilt+s3://bucket#package=test/hurdat" +./launch.sh run ./main.nf -profile standard -plugins $(PROJECT) --outdir "quilt+s3://bucket#package=test/hurdat" ``` ### Unit Testing diff --git a/README.md b/README.md index 75c7a201..35905f60 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,17 @@ Nextflow plugin for reading and writing Quilt packages [`nf-quilt`](https://github.com/quiltdata/nf-quilt) is a Nextflow -[plugin](https://www.nextflow.io/docs/latest/plugins.html) developed by [Quilt -Data, Inc.](https://quiltdata.com/) that enables you read and write directly to -Quilt packages wherever your Nextflow pipeline currently uses `s3` URIs. It -works with any Amazon S3-compatible object store, as long as you have the -appropriate +[plugin](https://www.nextflow.io/docs/latest/plugins.html) developed by +[Quilt Data, Inc.](https://quiltdata.com/) that enables you read and write +directly to Quilt packages wherever your Nextflow pipeline currently uses `s3` +URIs. It works with any Amazon S3-compatible object store, as long as you have +the appropriate [credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). Quilt packages are versioned, immutable, and shareable data containers that store data, metadata, and documentation as a single atomic unit. They are -accessible even by non-technical users via the Quilt Platfrom, a graphical -web catalog which runs either in your private AWS cloud or on +accessible even by non-technical users via the Quilt Platfrom, a graphical web +catalog which runs either in your private AWS cloud or on [open.quiltdata.com](https://open.quiltdata.com). ## Writing to Quilt Packages @@ -50,8 +50,8 @@ This also works with Nextflow Tower, where you can add the plugin to the ![Example Tower Configuration](./images/tower-config.png) -As of v0.9, you can also add a `quilt` section to your `nextflow.config` file -to specify the metadata and other plugin behaviors: +As of v0.9, you can also add a `quilt` section to your `nextflow.config` file to +specify the metadata and other plugin behaviors: ```groovy quilt { @@ -100,8 +100,8 @@ nextflow run nf-core/rnaseq --outdir "quilt+s3://$WRITE_BUCKET?key=value#package The `key=value` part is optional, and can be used to specify metadata for the package, which will be added to the metadata automatically generated by the -plugin. This is particularly when working with [Quilt -workflows](https://docs.quiltdata.com/workflows), which require specific +plugin. This is particularly when working with +[Quilt workflows](https://docs.quiltdata.com/workflows), which require specific metadata to be present before a package can be created. ### CLI Usage @@ -121,21 +121,21 @@ Note that you need to quote the URIs to prevent the shell from interpreting the There are a number of additional parameters you can set in order to customize the behavior of the plugin: -* **catalog**: specify the DNS hostname of the Quilt catalog to use (default: +- **catalog**: specify the DNS hostname of the Quilt catalog to use (default: None) -* **force**: completely replace the existing package, rather than updating it +- **force**: completely replace the existing package, rather than updating it (default: `false`) -* **meta**: specify a map of metadata to add to the package (default: `{}`) -* **message**: specify the commit message template to use when saving the +- **meta**: specify a map of metadata to add to the package (default: `{}`) +- **message**: specify the commit message template to use when saving the package -* **package**: specify the name of the package to read or write, when using an +- **package**: specify the name of the package to read or write, when using an S3 URI (default: the first two path components) -* **readme**: specify a template string for the package README_NF_QUILT.md file -* **summarize**: which files to display on the "front page" of the package via - `quilt_summarize.json` (default: +- **readme**: specify a template string for the package README_NF_QUILT.md file +- **summarize**: which files to display on the "front page" of the package via + `quilt_summarize.json` (default: `*.md,*.html,*.?sv,*.pdf,igv.json,**/multiqc_report.html`); use `false` to disable. -* **workflow**: specify the name of a Quilt workflow on that bucket to use for +- **workflow**: specify the name of a Quilt workflow on that bucket to use for metadata validation (default: None) NOTE: These configurations were previously specified as part of the Quilt+ URI. @@ -149,17 +149,17 @@ continue to use the query string (`?`) to specify metadata, including the You can customize both the `msg` and `readme` via template strings that use these `${variables}`: -* `cmd`: the current command line -* `meta`: the complete metadata -* `msg`: the current commit message -* `nextflow`: the current Nextflow configuration -* `now`: the ISO 8601 date and time -* `pkg`: the package name +- `cmd`: the current command line +- `meta`: the complete metadata +- `msg`: the current commit message +- `nextflow`: the current Nextflow configuration +- `now`: the ISO 8601 date and time +- `pkg`: the package name Note that the full `meta` is usually extremely large. You should use conditional keys to extract only the metadata you need, if present. For example: -```groovy +````groovy quilt { meta = [pipeline: 'nf-core/rnaseq'] msg = "${meta['config']?.get('runName')}: ${meta['cmd']}" @@ -189,4 +189,4 @@ ${nextflow} `${meta['workflow']?.get('stats')?.getAt('processes')}` ''' } -``` +````