-
Notifications
You must be signed in to change notification settings - Fork 429
Enabled tagliatelle and added relevant exclusions for it #7442
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
base: main
Are you sure you want to change the base?
Changes from all commits
6d8a06a
ee07bfe
57de4ea
e3987a5
c40312e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ linters: | |
| - revive | ||
| - staticcheck | ||
| - unused | ||
| - tagliatelle | ||
| settings: | ||
| gosec: | ||
| excludes: | ||
|
|
@@ -37,6 +38,141 @@ linters: | |
| - name: superfluous-else | ||
| - name: var-declaration | ||
| - name: duplicated-imports | ||
|
|
||
| tagliatelle: | ||
| case: | ||
| rules: | ||
| json: goCamel | ||
| yaml: goCamel | ||
| overrides: | ||
|
|
||
| - pkg: test | ||
| ignore: true | ||
| #Format for ignored-fields comments - current : expected | ||
| - pkg: pkg/ovs/ovsconfig | ||
| ignored-fields: | ||
| - DatapathType # datapath_type : datapathType | ||
| - ExternalIDs # external_ids : externalIDs | ||
| - McastSnoopingEnable # mcast_snooping_enable : mcastSnoopingEnable | ||
| - OFPortRequest # ofport_request : ofPortRequest | ||
|
|
||
| - pkg: pkg/flowaggregator/apis | ||
| ignored-fields: | ||
| - WithIPFIXExporter # withIPFIXExporter : withIpfixExporter | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried the following snippet but it did not work out.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| - pkg: pkg/config/flowaggregator | ||
| ignored-fields: | ||
| - MaxIPFIXMsgSize # maxIPFIXMsgSize : maxIpfixMsgSize | ||
|
|
||
| - pkg: pkg/config/controller | ||
| ignored-fields: | ||
| - ClientCAFile # clientCAFile : clientCaFile | ||
| - ClusterCIDRs # clusterCIDRs : clusterCidRs | ||
|
Comment on lines
+69
to
+70
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CA & CIDR should also be added as initialisms |
||
| - EnableNodeIPAM # enableNodeIPAM : enableNodeIpam | ||
| - IPsecCSRSignerConfig # ipsecCSRSigner : iPsecCsrSignerConfig | ||
| - NodeCIDRMaskSizeIPv4 # nodeCIDRMaskSizeIPv4 : nodeCidrMaskSizeIPv4 | ||
| - NodeCIDRMaskSizeIPv6 # nodeCIDRMaskSizeIPv6 : nodeCidrMaskSizeIPv6 | ||
| - NodeIPAM # nodeIPAM : nodeIpam | ||
| - SelfSignedCA # selfSignedCA : selfSignedCa | ||
| - ServiceCIDR # serviceCIDR : serviceCidr | ||
| - ServiceCIDRv6 # serviceCIDRv6 : serviceCidRv6 | ||
|
|
||
| - pkg: pkg/config/agent | ||
| ignored-fields: | ||
| - ClusterMembershipPort # clusterPort : clusterMembershipPort | ||
| - DefaultMTU # defaultMTU : defaultMtu | ||
| - DisableTXChecksumOffload # disableTXChecksumOffload : disableTxChecksumOffload | ||
| - ExceptCIDRs # exceptCIDRs : exceptCidRs | ||
| - IPsec # ipsec : iPsec | ||
| - NoSNAT # noSNAT : noSnat | ||
| - ServiceCIDR # serviceCIDR : serviceCidr | ||
| - ServiceCIDRv6 # serviceCIDRv6 : serviceCidRv6 | ||
| - TransportInterfaceCIDRs # transportInterfaceCIDRs : transportInterfaceCidR | ||
|
|
||
| - pkg: pkg/apiserver/apis | ||
| ignored-fields: | ||
| - AppliedPolicies # policies : appliedPolicies | ||
| - EgressDstRules # gressdstrules : egressDstRules | ||
| - IngressSrcRules # ingresssrcrules : ingressSrcRules | ||
| - PolicyRef # policyref' want 'policyRef | ||
| - RuleIndex # ruleindex : ruleIndex | ||
|
|
||
| - pkg: pkg/apis/system | ||
| ignored-fields: | ||
| - ObjectMeta # metadata : objectMeta | ||
|
|
||
| - pkg: pkg/apis/stats | ||
| ignored-fields: | ||
| - LastMeasuredRTTNanoseconds # lastMeasuredRTTNanoseconds : lastMeasuredRttNanoseconds | ||
| - ListMeta # metadata : listMeta | ||
| - ObjectMeta # metadata : objectMeta | ||
|
|
||
| - pkg: pkg/apis/crd | ||
| ignored-fields: | ||
| - APICABundle # apiCABundle : apicaBundle | ||
| - DstMAC # dstMAC : dstMac | ||
| - IPv6Header # 'ipv6Header : iPv6Header' | ||
| - ListMeta # metadata : listMeta | ||
| - LocalASN # localASN : localAsn | ||
| - MemberASNs # memberASNs : memberAsNs | ||
| - ObjectMeta # metadata : objectMeta | ||
|
|
||
| - pkg: pkg/apis/controlplane | ||
| ignored-fields: | ||
| - ListMeta # metadata : listMeta | ||
| - ObjectMeta # metadata : objectMeta | ||
|
|
||
| - pkg: pkg/antctl/raw | ||
| ignored-fields: | ||
| - IPv6Header # 'ipv6Header : iPv6Header' | ||
| - NodeResults # results : nodeResults | ||
| - TransportHeader # tranportHeader : transportHeader | ||
|
|
||
| - pkg: pkg/agent/flowexporter | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whole package be ignored as well, we don't control these names |
||
| ignored-fields: | ||
| - ContentLength # length : contentLength | ||
| - ContentType # http_content_type : contentType | ||
| - DestIP # dest_ip : destIP | ||
| - DestPort # dest_port : destPort | ||
| - EventType # event_type : eventType | ||
| - FlowID # flow_id : flowID | ||
| - InInterface # in_iface : inInterface | ||
| - Method # http_method : method | ||
| - SrcIP # src_ip : srcIP | ||
| - SrcPort # src_port : srcPort | ||
| - TxID # tx_id : txID | ||
| - UserAgent # http_user_agent : userAgent | ||
|
|
||
| - pkg: pkg/agent/cniserver | ||
| ignored-fields: | ||
| - IPPools # ippools : ipPools | ||
| - Nameservers # servers : nameservers | ||
| - RawPrevResult # prevResult : rawPrevResult | ||
| - Search # searches : search | ||
|
|
||
| - pkg: pkg/agent/apis | ||
| ignored-fields: | ||
| - BGPPolicyName # name' want 'bgpPolicyName | ||
| - IPs # ips : iPs | ||
| - LocalASN # localASN : localAsn | ||
| - MemberASNs # memberASNs : memberAsNs | ||
| - Nameservers # servers : nameservers | ||
| - PodName # name' want 'podName | ||
|
|
||
| - pkg: multicluster/apis/multicluster | ||
| ignored-fields: | ||
| - ListMeta # metadata : listMeta | ||
| - ObjectMeta # metadata : objectMeta | ||
| - PodCIDRs # podCIDRs : podCidRs | ||
| - ServiceCIDR # serviceCIDR : serviceCidr | ||
|
|
||
| - pkg: pkg/agent/util | ||
| ignored-fields: | ||
| - Extensions # Extensions : extensions | ||
| - ExtensionID # Id : extensionID | ||
|
Comment on lines
+169
to
+172
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| use-field-name: true | ||
|
|
||
| exclusions: | ||
| presets: | ||
| - legacy | ||
|
|
||
There was a problem hiding this comment.
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.