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

feat: add exhaustruct linter #2667

Merged
merged 7 commits into from Apr 30, 2022
Merged

feat: add exhaustruct linter #2667

merged 7 commits into from Apr 30, 2022

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented Mar 20, 2022

This linter can be called a successor of exhaustivestruct, and:

  • it is at least 2.5+ times faster, due to better algorithm;
  • can receive include and/or exclude patterns;
  • expects received patterns to be RegExp, therefore this package is not api-compatible with exhaustivestruct.

Also: deprecate exhaustivestruct linter

@boring-cyborg
Copy link

@boring-cyborg boring-cyborg bot commented Mar 20, 2022

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

@CLAassistant CLAassistant commented Mar 20, 2022

CLA assistant check
All committers have signed the CLA.

@ldez ldez added enhancement linter: new labels Mar 20, 2022
@ldez
Copy link
Member

@ldez ldez commented Mar 20, 2022

Hello @xobotyi,

why didn't you do a PR on exhaustivestruct instead of creating a copy?

I think that you will have a license issue.

@ldez ldez added the blocked label Mar 20, 2022
@xobotyi
Copy link
Contributor Author

@xobotyi xobotyi commented Mar 20, 2022

@ldez pr is there for like.. half a year now. mbilski/exhaustivestruct#17

Linter name and codebases are different (codebase, actually, is complete rewrite) why there should be a licensing issues?

Not even saying that exhaustivestruct is published under MIT licence, that does not forbid that.

@ldez
Copy link
Member

@ldez ldez commented Mar 20, 2022

Not even saying that exhaustivestruct is published under MIT licence, that does not forbid that.

The MIT license is clear:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

@xobotyi
Copy link
Contributor Author

@xobotyi xobotyi commented Mar 20, 2022

@ldez as said - the code is completely mine and have nothing in common (except purpose and usage of analyzer) with other linter - it can't be treated as "modification".

@ldez
Copy link
Member

@ldez ldez commented Mar 20, 2022

My login is LDEZ

@xobotyi
Copy link
Contributor Author

@xobotyi xobotyi commented Mar 20, 2022

@ldez oh that's why siggestion didn't worked out😂
Visually, on mobile app it looks identical😅

@ldez
Copy link
Member

@ldez ldez commented Mar 20, 2022

also, you don't need to ping me on every message.

@ldez ldez self-requested a review Mar 22, 2022
@ldez ldez added blocked and removed blocked labels Mar 29, 2022
@ldez
Copy link
Member

@ldez ldez commented Mar 29, 2022

Can you rebase your PR? Thanks.

@xobotyi
Copy link
Contributor Author

@xobotyi xobotyi commented Mar 30, 2022

Done

pkg/golinters/exhaustruct.go Outdated Show resolved Hide resolved
pkg/lint/lintersdb/manager.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@ldez
Copy link
Member

@ldez ldez commented Mar 30, 2022

You don't need to squash, the PR is squashed during the merge.
It's better to keep the history of the PR changes.

@xobotyi
Copy link
Contributor Author

@xobotyi xobotyi commented Mar 30, 2022

I dont squash, it is ammend (habit from gerrit - review tool that im using at work).

@ldez
Copy link
Member

@ldez ldez commented Mar 30, 2022

I dont squash, it is ammend (habit from gerrit - review tool that im using at work).

The conclusion is the same: all the previous commits have been squashed into one commit.

this is not a good practice on GitHub because we lost the history of changes.

Otherwise, I recommend using git push --force-with-lease instead of git push -f or git push --force.

https://git-scm.com/docs/git-push

I also recommend not using the branch master but a dedicated branch when creating PR.

https://blog.jasonmeridth.com/posts/do-not-issue-pull-requests-from-your-master-branch/

pkg/golinters/exhaustruct.go Outdated Show resolved Hide resolved
@ldez ldez added feedback required and removed enhancement labels Apr 8, 2022
@ldez ldez removed the feedback required label Apr 24, 2022
xobotyi and others added 6 commits Apr 30, 2022
This linter can be called a successor of `exhaustivestruct`, and:

- it is at least **2.5+ times faster**, due to better algorithm;
- can receive `include` and/or `exclude` patterns;
- expects received patterns to be RegExp, therefore this package is not api-compatible with `exhaustivestruct`.

Also: deprecate `exhaustivestruct` linter
ldez
ldez approved these changes Apr 30, 2022
Copy link
Member

@ldez ldez left a comment

LGTM

@ldez ldez merged commit 380699a into golangci:master Apr 30, 2022
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter: new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants