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

Enable more revive linter rules #5506

Open
yurishkuro opened this issue Jun 2, 2024 · 2 comments
Open

Enable more revive linter rules #5506

yurishkuro opened this issue Jun 2, 2024 · 2 comments
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@yurishkuro
Copy link
Member

In #5505 we introduced a revive linter, but had to disable many of its rules because they were breaking on some places in the code.

rules:

We can re-enable those rules incrementally by fixing the corresponding breaks one rule at a time (make lint should succeed) and removing the disabling entry from the config.

@yurishkuro yurishkuro added help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels Jun 2, 2024
@FlamingSaint
Copy link
Member

Is it okay to remove multiple rules in the same PR ?

@yurishkuro
Copy link
Member Author

Only if the changes are really small. I would recommend not mixing different changes / rules in one PR.

yurishkuro pushed a commit that referenced this issue Jun 3, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled bare-return in revive linter. 
- Removed naked returns.
- Enabled empty-lines in revive linter.

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
yurishkuro pushed a commit that referenced this issue Jun 3, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled dot-imports in revive linter. 
- Removed dot imports in a few and added qualifiers for the rest.

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
yurishkuro pushed a commit that referenced this issue Jun 3, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled unused-receiver in revive linter
- Removed receiver names which are not used in functions 

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
yurishkuro pushed a commit that referenced this issue Jun 3, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled modifies-value-receiver in revive linter. 
- Removed instances where pass-by-values where re-assigned and returned.

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
yurishkuro added a commit that referenced this issue Jun 4, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled confusing-results & receiver-naming in revive linter
- Used named outputs when datatype of outputs are same
- Made changes to maintain the same receiver name 

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
yurishkuro added a commit that referenced this issue Jun 4, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled exported in revive linter
- Converted struct `Config` to `ConfigurationV2`
- Converted struct `DependencyStoreParams` to `Params`
- Converted struct `SamplingStoreParams` to `Params`

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
yurishkuro added a commit that referenced this issue Jun 4, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled  early-return & indent-error-flow in revive linter
- Simplified if-else blocks

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
yurishkuro pushed a commit that referenced this issue Jun 5, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled struct-tag & unexported-return in revive linter
- Only use tags on exported fields
- Converted exported function to have an exported return type

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`
  -

---------

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
yurishkuro pushed a commit that referenced this issue Jun 7, 2024
## Which problem is this PR solving?
-  Partial Fix for #5506

## Description of the changes
- Enabled unused-parameter in revive linter
- Removed or replaced unused parameters with ( _ )
- Added comments for unclear parameters 

## How was this change tested?
- `make lint` `make test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`
  -

---------

Signed-off-by: FlamingSaint <raghuramkannan400@gmail.com>
yurishkuro pushed a commit that referenced this issue Aug 16, 2024
<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! 👋🎉
-->

## Which problem is this PR solving?
- Partial Fix for #5506

## Description of the changes
- Enabled redefines-builtin-id in revive linter. Replaced function name
which redefinition of the built-in function

## How was this change tested?
- make lint make test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: ZXYxc <reisaruxxii@gmail.com>
JaredTan95 pushed a commit to JaredTan95/jaeger that referenced this issue Aug 28, 2024
<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! 👋🎉
-->

## Which problem is this PR solving?
- Partial Fix for jaegertracing#5506

## Description of the changes
- Enabled redefines-builtin-id in revive linter. Replaced function name
which redefinition of the built-in function

## How was this change tested?
- make lint make test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: ZXYxc <reisaruxxii@gmail.com>
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
Development

No branches or pull requests

2 participants