Skip to content

Conversation

@KishanPipariya
Copy link

Added tagliatelle in golangci-lint as per requirements mentioned in #7344

.golangci.yml Outdated
rules:
json: goCamel
yaml: goCamel
ignored-fields:
Copy link
Contributor

Choose a reason for hiding this comment

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

for each field, could you add as a comment the actual tag name vs the expected one, for reference and to help with review?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I can do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see that change

Copy link
Author

Choose a reason for hiding this comment

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

I added an incorrect version of the file. I am adding the new one right now.

Copy link
Author

Choose a reason for hiding this comment

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

Could you let me know if there any further issues?

@KishanPipariya
Copy link
Author

KishanPipariya commented Sep 23, 2025

I am currently waiting for an tagliatelle issue to be resolved. Issue
Resolving this issue will reduce a large number of exemptions.

@KishanPipariya KishanPipariya force-pushed the tagliatelle_addition branch 2 times, most recently from ca75cf1 to bfead10 Compare October 1, 2025 03:26
@KishanPipariya
Copy link
Author

I have added the expected names for reference. I still could not get the custom initialisms to work.

.golangci.yml Outdated
- AppliedPolicies # policies : appliedPolicies
- AppProtocol # app_proto : appProtocol
- BGPPolicyName # name' want 'bgpPolicyName
- BrName #ovsBinding : brName
Copy link
Contributor

Choose a reason for hiding this comment

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

this is in a test file, can we exclude test files?

.golangci.yml Outdated
- ClusterNetworkPolicy # clusternetworkpolicy : clusterNetworkPolicy
- ContentLength # length : contentLength
- ContentType # http_content_type : contentType
# - AppliedPolicies
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a duplicate that can be removed?

.golangci.yml Outdated
rules:
json: goCamel
yaml: goCamel
ignored-fields: # Current: Expected
Copy link
Contributor

Choose a reason for hiding this comment

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

do you know if the "scope" for each ignored field can be limited to a single type / file? I don't think we want exceptions to apply "globally"

Copy link
Author

Choose a reason for hiding this comment

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

I will try to see if it is possible to do this.

@KishanPipariya
Copy link
Author

I addressed the issues you previously mentioned @antoninbas.

- pkg: test
ignore: true
#Format for ignored-fields comments - current : expected
- pkg: pkg/ovs/ovsconfig
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be ignored as well. We don't control the tags, they are based on the OVSDB schema.


- pkg: pkg/flowaggregator/apis
ignored-fields:
- WithIPFIXExporter # withIPFIXExporter : withIpfixExporter
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add IPFIX as an initialism, or did you say it was not working?

Copy link
Author

@KishanPipariya KishanPipariya Oct 9, 2025

Choose a reason for hiding this comment

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

I tried the following snippet but it did not work out.
Snippet:

Extended-rules:
   yaml:
       case: goCamel
       extra-initialisms: true
       initialism-overrides:
          IFPIX: true
          IPAM: true

Copy link
Author

Choose a reason for hiding this comment

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

I have also asked the folks at tagliatelle, to see if it's a error from my end or there is a problem with the linter.

Copy link
Author

Choose a reason for hiding this comment

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

Got a response from their end: ldez/tagliatelle#30 (comment)

I will try resolving it from my end and if it is not possible, raise an issue for tagliatelle.

Comment on lines +69 to +70
- ClientCAFile # clientCAFile : clientCaFile
- ClusterCIDRs # clusterCIDRs : clusterCidRs
Copy link
Contributor

Choose a reason for hiding this comment

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

CA & CIDR should also be added as initialisms

- NodeResults # results : nodeResults
- TransportHeader # tranportHeader : transportHeader

- pkg: pkg/agent/flowexporter
Copy link
Contributor

Choose a reason for hiding this comment

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

whole package be ignored as well, we don't control these names

Comment on lines +169 to +172
- pkg: pkg/agent/util
ignored-fields:
- Extensions # Extensions : extensions
- ExtensionID # Id : extensionID
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, I don't think we control or can change these tags

BTW, it may be better to add //nolint:tagliatelle on struct definitions for which we don't have control over the tags. Can you check if it works?

Copy link
Author

Choose a reason for hiding this comment

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

Could you clarify a bit about //nolint:tagliatelle and where to place it? Also are agent and ovs the only packages not in our control?

Copy link
Author

@KishanPipariya KishanPipariya Oct 10, 2025

Choose a reason for hiding this comment

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

I could not get the extra-initialisms to work for Antrea. I tried the same yaml config on small dummy programs and it worked. So I am trying to figure out what's causing this issue.

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.

2 participants