diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 121f450a6977530636ca805aad3723cea617850d..62d9791d7cbc87e706e614edd5271eee7e56b0ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,8 @@ # yaml-language-server: $format.enable=false stages: + - linters + - checkout - environment - compilers - concretize @@ -104,7 +106,7 @@ variables: # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ spack:checkout: - stage: .pre + stage: checkout variables: APPTAINER_EXEC_OPTIONS: >- --cleanenv @@ -257,3 +259,40 @@ post_cleaning: - ${environment} script: - ./ci/cleaning_fs.sh + +.code-quality: &code-climate + stage: linters + image: + name: registry.hpc.epfl.ch/scitas/linters-collection:latest + pull_policy: always + allow_failure: true + after_script: + - | + if [ ! -s gl-codequality.json ]; then + echo [] | tee gl-codequality.json | jq -C .; + fi + artifacts: + reports: + codequality: [gl-codequality.json] + paths: + - gl-codequality.json + +cq:hadolint: + <<: *code-climate + script: + - hadolint --format codeclimate dockerfiles/**/Dockerfile | tee gl-codequality.json | jq -C . + +cq:shellcheck: + <<: *code-climate + script: + - | + git ls-files . \ + | xargs -r -n1 file \ + | awk -F: '/shell script/{print $1}' \ + | xargs -r -n1 shellcheck -f json \ + | tee -a gl-codequality.json | jq -C . + +cq:yamllint: + <<: *code-climate + script: + - yamllint_codeclimate --standalone | tee gl-codequality.json | jq -C . diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000000000000000000000000000000000000..440d70de7dae370acfeed47b94965482530b4319 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,9 @@ +--- +failure-threshold: "style" # name of threshold level (error | warning | info | style | ignore | none) +format: "codeclimate" # Output format (tty | json | checkstyle | codeclimate | gitlab_codeclimate | gnu | codacy) +ignored: ["DL3041"] # list of rules +no-color: false # true | false +strict-labels: true # true | false +trustedRegistries: + - "registry.hpc.epfl.ch" # registry or list of registries + - "docker.io" diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000000000000000000000000000000000000..45efdb5af1273855af119f5a24e1b292b6a7891e --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + line-length: + ignore: + - .hadolint.yaml + - .gitlab-ci.yml diff --git a/stacks/pinot-noir-gcc/modules_empty.yaml b/stacks/pinot-noir-gcc/modules_empty.yaml new file mode 100644 index 0000000000000000000000000000000000000000..21d0544839675931122d4455d2fe32408b425fe5 --- /dev/null +++ b/stacks/pinot-noir-gcc/modules_empty.yaml @@ -0,0 +1,3 @@ +modules: + default: + lmod: {}