From 71ede6ccca2b2af7f3429b1b39730d0e4834551f Mon Sep 17 00:00:00 2001 From: kpj Date: Thu, 24 Sep 2020 15:54:24 +0200 Subject: [PATCH 1/3] Add missing 'GetLinterRules' calls --- lib/linter.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/linter.sh b/lib/linter.sh index b3c455d4..703128a2 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1312,6 +1312,10 @@ GetLinterRules "PYTHON_BLACK" GetLinterRules "R" # Get Ruby rules GetLinterRules "RUBY" +# Get Snakemake lint rules +GetLinterRules "SNAKEMAKE_LINT" +# Get Snakemake snakefmt rules +GetLinterRules "SNAKEMAKE_SNAKEFMT" # Get SQL rules GetLinterRules "SQL" # Get Terraform rules From 40f995365bb2403faf02b2d1204a0589659bf842 Mon Sep 17 00:00:00 2001 From: kpj Date: Thu, 24 Sep 2020 15:55:47 +0200 Subject: [PATCH 2/3] Fix Snakefile regex --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 703128a2..e6b82d99 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1938,7 +1938,7 @@ if [ "${VALIDATE_SNAKEMAKE_LINT}" == "true" ]; then # Lint the files with snakefmt # ################################ # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILTER_REGEX_INCLUDE" "FILTER_REGEX_EXCLUDE" "FILE_ARRAY" - LintCodebase "SNAKEMAKE_LINT" "snakemake" "snakemake --lint -s" "\(Snakefile|.*\.smk\)\$" "${FILTER_REGEX_INCLUDE}" "${FILTER_REGEX_EXCLUDE}" "${FILE_ARRAY_SNAKEMAKE[@]}" + LintCodebase "SNAKEMAKE_LINT" "snakemake" "snakemake --lint -s" ".*\(Snakefile\|\.smk\)\$" "${FILTER_REGEX_INCLUDE}" "${FILTER_REGEX_EXCLUDE}" "${FILE_ARRAY_SNAKEMAKE[@]}" fi @@ -1950,7 +1950,7 @@ if [ "${VALIDATE_SNAKEMAKE_SNAKEFMT}" == "true" ]; then # Lint the files with snakefmt # ################################ # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILTER_REGEX_INCLUDE" "FILTER_REGEX_EXCLUDE" "FILE_ARRAY" - LintCodebase "SNAKEMAKE_SNAKEFMT" "snakefmt" "snakefmt --config ${SNAKEMAKE_SNAKEFMT_LINTER_RULES} --check --compact-diff" "\(Snakefile|.*\.smk\)\$" "${FILTER_REGEX_INCLUDE}" "${FILTER_REGEX_EXCLUDE}" "${FILE_ARRAY_SNAKEMAKE[@]}" + LintCodebase "SNAKEMAKE_SNAKEFMT" "snakefmt" "snakefmt --config ${SNAKEMAKE_SNAKEFMT_LINTER_RULES} --check --compact-diff" ".*\(Snakefile\|\.smk\)\$" "${FILTER_REGEX_INCLUDE}" "${FILTER_REGEX_EXCLUDE}" "${FILE_ARRAY_SNAKEMAKE[@]}" fi ###################### From 9e7c84fbbb18e805997593c2a3f40edfab20afb5 Mon Sep 17 00:00:00 2001 From: kpj Date: Thu, 24 Sep 2020 16:06:12 +0200 Subject: [PATCH 3/3] Fix various Snakemake related variable names --- Dockerfile | 2 +- README.md | 2 +- lib/linter.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fda1d9a4..ba371954 100644 --- a/Dockerfile +++ b/Dockerfile @@ -346,7 +346,7 @@ ENV ACTIONS_RUNNER_DEBUG=${ACTIONS_RUNNER_DEBUG} \ OUTPUT_FOLDER=${OUTPUT_FOLDER} \ OUTPUT_FORMAT=${OUTPUT_FORMAT} \ RUN_LOCAL=${RUN_LOCAL} \ - SNAKEMAKE_CONFIG_FILE=${SNAKEMAKE_CONFIG_FILE} \ + SNAKEMAKE_SNAKEFMT_CONFIG_FILE=${SNAKEMAKE_SNAKEFMT_CONFIG_FILE} \ TEST_CASE_RUN=${TEST_CASE_RUN} \ VALIDATE_ALL_CODEBASE=${VALIDATE_ALL_CODEBASE} \ VALIDATE_ANSIBLE=${VALIDATE_ANSIBLE} \ diff --git a/README.md b/README.md index 03a4e9a4..bdcedfc7 100644 --- a/README.md +++ b/README.md @@ -222,7 +222,7 @@ But if you wish to select or exclude specific linters, we give you full control | **PYTHON_FLAKE8_CONFIG_FILE** | `.flake8` | Filename for [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) (ex: `.flake8`, `tox.ini`) | | **PYTHON_BLACK_CONFIG_FILE** | `.python-black` | Filename for [black configuration](https://github.com/psf/black/blob/master/docs/compatible_configs.md) (ex: `.isort.cfg`, `pyproject.toml`) | | **RUBY_CONFIG_FILE** | `.ruby-lint.yml` | Filename for [rubocop configuration](https://docs.rubocop.org/rubocop/configuration.html) (ex: `.ruby-lint.yml`, `.rubocop.yml`) | -| **SNAKEMAKE_CONFIG_FILE** | `.snakefmt.toml` | Filename for [Snakemake configuration](https://github.com/snakemake/snakefmt#configuration) (ex: `pyproject.toml`, `.snakefmt.toml`) | +| **SNAKEMAKE_SNAKEFMT_CONFIG_FILE**| `.snakefmt.toml` | Filename for [Snakemake configuration](https://github.com/snakemake/snakefmt#configuration) (ex: `pyproject.toml`, `.snakefmt.toml`) | | **TYPESCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) | | **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. | | **VALIDATE_ANSIBLE** | `true` | Flag to enable or disable the linting process of the Ansible language. | diff --git a/lib/linter.sh b/lib/linter.sh index e6b82d99..112f70b9 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -119,8 +119,8 @@ R_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${R_FILE_NAME}" # Path to the R lint r RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file RUBY_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${RUBY_FILE_NAME}" # Path to the ruby lint rules # Snakemake Vars -SNAKEMAKE_FILE_NAME="${SNAKEMAKE_CONFIG_FILE:-.snakefmt.toml}" # Name of the file -SNAKEMAKE_SNAKEFMT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${SNAKEMAKE_FILE_NAME}" # Path to the snakemake lint rules +SNAKEMAKE_SNAKEFMT_FILE_NAME="${SNAKEMAKE_SNAKEFMT_CONFIG_FILE:-.snakefmt.toml}" # Name of the file +SNAKEMAKE_SNAKEFMT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${SNAKEMAKE_SNAKEFMT_FILE_NAME}" # Path to the snakemake lint rules # SQL Vars SQL_FILE_NAME=".sql-config.json" # Name of the file SQL_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${SQL_FILE_NAME}" # Path to the SQL lint rules