Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Option to disable for imported libraries #16

Open
electrofelix opened this issue Jul 20, 2022 · 1 comment · May be fixed by #22
Open

Option to disable for imported libraries #16

electrofelix opened this issue Jul 20, 2022 · 1 comment · May be fixed by #22

Comments

@electrofelix
Copy link

Given that underscores are common in protobufs, particular around enums, where the following definition from https://developers.google.com/protocol-buffers/docs/proto3#enum:

message SearchRequest {
  string query = 1;
  int32 page_number = 2;
  int32 result_per_page = 3;
  enum Corpus {
    UNIVERSAL = 0;
    WEB = 1;
    IMAGES = 2;
    LOCAL = 3;
    NEWS = 4;
    PRODUCTS = 5;
    VIDEO = 6;
  }
  Corpus corpus = 4;
}

Will in generated code resolve to CORPUS_UNIVERSAL, CORPUS_WEB, ....

It would be useful to be able to ignore all instances such as this coming in from specific imported libraries where the consuming project does not have control over the naming. As we make use of protobuf and enums, I've had to disable the linter as there are no many occurrences of this caught, while I would prefer to leave it to catch the odd mistake automatically.

@rtpt-erikgeiser
Copy link

In my opinion the linter should actually only check new declarations and type definitions in the current project. I'm not aware of any linter that flags issues that stem from other dependencies. Currently nosnakecase even flags stuff from the standard library such as the constants from x/sys/unix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants