From e20ef9dd21b75896849ee2279fc2fa2fc3043a2a Mon Sep 17 00:00:00 2001 From: f Date: Fri, 12 Jan 2024 17:44:26 -0300 Subject: [PATCH] feat: no es necesario pasar los archivos como parametros --- .gitlab-ci.yml | 4 ++-- Taskfile.yaml | 12 ++++-------- bin/modified_files | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb2766d3..9718e770 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,7 +85,7 @@ rubocop: - *apk-add - *disable-hainish script: - - "./bin/modified_files | ./bin/with_extension rb | xargs -r go-task bundle -- exec rubocop" + - "go-task rubocop" haml: stage: "test" cache: @@ -96,4 +96,4 @@ haml: - *apk-add - *disable-hainish script: - - "./bin/modified_files | ./bin/with_extension haml | xargs -r go-task bundle -- exec haml-lint" + - "go-task haml-lint" diff --git a/Taskfile.yaml b/Taskfile.yaml index 735724f5..57fb0238 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -184,14 +184,10 @@ tasks: status: - "test -f ../hain/usr/bin/bundler-audit" rubocop: - desc: "Ruby linting. Call with: go-task rubocop -- -A file.rb" + desc: "Ruby linting" cmds: - - task: "bundle" - vars: - CLI_ARGS: "exec rubocop {{.CLI_ARGS}}" + - "./bin/modified_files | ./bin/with_extension rb | xargs -r {{.HAINISH}} bundle exec rubocop {{.CLI_ARGS}}" haml-lint: - desc: "HAML linting. Call with: go-task haml-lint -- file.haml" + desc: "HAML linting" cmds: - - task: "bundle" - vars: - CLI_ARGS: "exec haml-lint {{.CLI_ARGS}}" + - "./bin/modified_files | ./bin/with_extension haml | xargs -r {{.HAINISH}} bundle exec haml-lint {{.CLI_ARGS}}" diff --git a/bin/modified_files b/bin/modified_files index d26e71f3..4d06b4c5 100755 --- a/bin/modified_files +++ b/bin/modified_files @@ -1,7 +1,7 @@ #!/bin/sh set -e -test -n "${CI_MERGE_REQUEST_DIFF_BASE_SHA}" +CI_MERGE_REQUEST_DIFF_BASE_SHA="${CI_MERGE_REQUEST_DIFF_BASE_SHA:-origin/rails}" git diff --name-status ${CI_MERGE_REQUEST_DIFF_BASE_SHA} \ | grep -v "^D" \