Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically download the golangci-lint if not exists #1491

Merged
merged 10 commits into from
Jul 4, 2023

Conversation

infdahai
Copy link
Contributor

@infdahai infdahai commented Jun 11, 2023

I use dpkg to install golanglint-ci packags in sys_path because the visit to raw.github.com for me is unstable. So I think we can support this way about system paths.

user$ which golangci-lint
/usr/bin/golangci-lint

If we find the package exists in system path, we will do check-version function and the program raises an error to tell users to update system packages if the check fails.
If we don't find it, we get the package from GoPATH or download it from github.

These two ways are from https://golangci-lint.run/usage/install/.

Signed-off-by: clundro <infdahai@outlook.com>
@infdahai infdahai force-pushed the golangci_lint branch 2 times, most recently from 4dee6ca to c9a6f64 Compare June 11, 2023 08:14
Signed-off-by: clundro <infdahai@outlook.com>
x.py Outdated Show resolved Hide resolved
infdahai and others added 3 commits June 11, 2023 17:23
Signed-off-by: clundro <infdahai@outlook.com>
Signed-off-by: clundro <infdahai@outlook.com>
@PragmaTwice PragmaTwice requested a review from tisonkun June 13, 2023 03:39
x.py Outdated Show resolved Hide resolved
Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please check the path to golangci-lint in one step, and download in another step. You currently mix up all these logics.
  2. Please build the download URL with the predefined GOLANGCI_LINT_REQUIRED_VERSION so that we don't miss update multiple place.

@git-hulk git-hulk changed the title Get golangci_lint from system path Automatically download the golangci-lint if not exists Jun 14, 2023
x.py Show resolved Hide resolved
infdahai added 2 commits June 14, 2023 22:14
Signed-off-by: clundro <infdahai@outlook.com>
Signed-off-by: clundro <infdahai@outlook.com>
@PragmaTwice PragmaTwice requested a review from tisonkun June 16, 2023 07:33
Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. cc @tisonkun

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tisonkun tisonkun merged commit ed0f985 into apache:unstable Jul 4, 2023
@infdahai infdahai deleted the golangci_lint branch July 5, 2023 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants