Commit a1e550f5 authored by Thomas Boni's avatar Thomas Boni
Browse files

Merge branch '655-golint-fix-plug-and-play-usage' into 'latest'

Resolve "[golint] - fix plug and play usage"

Closes #655

See merge request r2devops/hub!413
parents c853dbc5 49f251f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ links_checker:
    # job will be migrated to a new tool soon (see #314)
    LICHE_EXCLUDE: ^([^http]|https://gitlab.com/r2devops/hub/-/forks/new)|^([^http]|https://r2devops.io/.+)|^([^http]|https://api.r2devops.io/.+)
    FAIL_ON_BROKEN: "true"
    LICHE_DIRECTORY: "docs/"
    LICHE_DIRECTORY: "jobs/"
  allow_failure: true

# See https://docs.gitlab.com/ee/api/labels.html
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ Deploy your PHP project using [Deployer](https://deployer.org/){:target="_blank"
    !!! info
        `SSH_KNOWN_HOSTS` needs to contain the same data that we find in the file `.ssh/known_hosts`, this step is needed so that the SSH connection doesn't ask to add the server to `.ssh/known_hosts` as you wouldn't be able to interact with the terminal.

1. Make sure that you have the deployer config file (`deploy.php` or `deploy.yaml`) in the root folder of your project, More info in [this guide](https://deployer.org/docs/getting-started.html){:target="_blank"}
1. Make sure that you have the deployer config file (`deploy.php` or `deploy.yaml`) in the root folder of your project, More info in [this guide](https://deployer.org/docs/7.x/getting-started){:target="_blank"}
1. If you need to customize other part of the job (stage, variables, ...) 👉
   check the [jobs customization](/use-the-hub/#jobs-customization)
1. Well done, your job is ready to work ! 😀
+5 −6
Original line number Diff line number Diff line
@@ -5,12 +5,11 @@ ESLint statically analyzes your code to quickly find problems in your JavaScript
## How to use it


1. Add this job URL inside the `include` list of your `.gitlab-ci.yml` file (see the [quick setup](/use-the-hub/#quick-setup)). You can specify [a fixed version](#changelog) instead of `latest`.
    ```yaml
      - remote: 'https://jobs.r2devops.io/latest/eslint.yml'
    ```
1. If you need to customize the job (stage, variables, ...) 👉 check the [jobs
   customization](/use-the-hub/#jobs-customization)
1. Copy/paste job URL in `include` list of your `.gitlab-ci.yml` (see the
   [quick setup](/use-the-hub/#quick-setup)). You can specify [a fixed
   version](#changelog) instead of `latest`.
1. The job can be run "out of the box". If you need to personalize its
   behavior, check the [variables section](#variables)
1. Well done, your job is ready to work ! 😀

## Variables
+4 −0
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [1.2.0] - 2022-10-28
* Add `GOLINT_OUTPUT_FORMAT` variable to export the report as `junit` or `code-climate` artifact
* Fix the Junit report artifact

## [1.1.0] - 2022-06-13
* Add docker image tag in variable 

+14 −11
Original line number Diff line number Diff line
@@ -4,20 +4,23 @@ A ready-to-use job to lint your Golang project. It includes a lot of linters suc

## How to use it

1. Add this job URL inside the `include` list of your `.gitlab-ci.yml` file (see the [quick setup](/use-the-hub/#quick-setup)). You can specify [a fixed version](#changelog) instead of `latest`.
    ```yaml
      - remote: 'https://jobs.r2devops.io/latest/golint.yml'
    ```
1. If you need to customize the job (stage, variables, ...) 👉 check the [jobs
   customization](/use-the-hub/#jobs-customization)
1. Copy/paste job URL in `include` list of your `.gitlab-ci.yml` (see the
   [quick setup](/use-the-hub/#quick-setup)). You can specify [a fixed
   version](#changelog) instead of `latest`.
1. The job can be run "out of the box". If you need to personalize its
   behavior, check the [variables section](#variables)
1. Well done, your job is ready to work ! 😀

## Variables

| Name | Description | Default |
| ---- | ----------- | ------- |
| `CONFIG_LOCATION` <img width=100/> | Specify whether a config file needs to be used <img width=175/>| ` ` <img width=100/>|
| `PROJECT_ROOT` | Path to the root of project to lint | `.` |
| `ADDITIONAL_OPTIONS` | [Additional options](https://golangci-lint.run/usage/configuration/) available for the user, they are added at the end of test command | ` ` |
| `GOLINT_OUTPUT` | Name of the output file | `report-golint.xml` |
| `IMAGE_TAG` | The default tag for the docker image | `v1.43.0`  |
| `PROJECT_ROOT` <img width=100/>  | Path to the root of the project to lint <img width=175/>| `.` <img width=100/>|
| `GOLINT_CONFIG` | Specify whether a [config file](https://golangci-lint.run/usage/configuration/) needs to be used.  | ` ` |
| `GOLINT_REPORTS_DIRECTORY` | Name for the reports directory | `reports` |
| `GOLINT_OUTPUT_FORMAT` | Format for the linters. Could be `junit-xml`, `code-climate` or `colored-line-number` for printing the output in the console.  | `junit-xml` |
| `ADDITIONAL_OPTIONS` | [Additional options](https://golangci-lint.run/usage/configuration/) available for the user, they are added at the end of lint command | ` ` |
| `IMAGE_TAG` | The default tag for the docker image | `v1.50.1`  |

## Author
This resource is an **[official job](https://docs.r2devops.io/faq-labels/)** added in [**R2Devops repository**](https://gitlab.com/r2devops/hub) by [@Alexia](https://gitlab.com/alexiaognard). Was improved by [@GridexX](https://gitlab.com/GridexX) on October 2022.
Loading