[
https://issues.apache.org/jira/browse/YUNIKORN-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17149063#comment-17149063
]
Wilfred Spiegelenburg edited comment on YUNIKORN-263 at 7/1/20, 2:54 AM:
-------------------------------------------------------------------------
In the PR I see that you added the proposed skipping of just that one directory.
However I am not sure if that is correct and that is why I logged this jira.
Looking at the 2 directories involved I see that these files do not have a
"Code generated by" comment:
{code:java|title=client directory}
./kubeclient.go
./apifactory_mock.go
./apifactory.go
./interfaces.go
./kubeclient_mock.go
./clients.go
{code}
{code:java|title=apis directory}
./yunikorn.apache.org/register.go
./yunikorn.apache.org/v1alpha1/register.go
./yunikorn.apache.org/v1alpha1/type.go
./yunikorn.apache.org/v1alpha1/doc.go
{code}
If those files are not generated then we should not exclude them from the lint
checks.
Also leveraging the config file for this instead of using the command line
switch would be a better option.
{code}
run:
deadline: 5m
skip-dirs:
- pkg/client/clientset
- ...
{code}
BTW: this all seems to be a workaround until we get a version for golangci-lint
which has the changes from this PR:
https://github.com/golangci/golangci-lint/pull/1161
That fixes the auto detect for the files.
was (Author: wifreds):
In the PR I see that you added the proposed skipping of just that one directory.
However I am not sure if that is correct and that is why I logged this jira.
Looking at the 2 directories involved I see that these files do not have a
"Code generated by" comment:
{code:java|title=client directory}
./kubeclient.go
./apifactory_mock.go
./apifactory.go
./interfaces.go
./kubeclient_mock.go
./clients.go
{code}
{code:java|title=apis directory}
./yunikorn.apache.org/register.go
./yunikorn.apache.org/v1alpha1/register.go
./yunikorn.apache.org/v1alpha1/type.go
./yunikorn.apache.org/v1alpha1/doc.go
{code}
If those files are not generated then we should not exclude them from the lint
checks.
Also leveraging the config file for this instead of using the command line
switch would be a better option.
{code}
run:
deadline: 8m
skip-dirs:
- pkg/client/clientset
- ...
{code}
BTW: this all seems to be a workaround until we get a version for golangci-lint
which has the changes from this PR:
https://github.com/golangci/golangci-lint/pull/1161
That fixes the auto detect for the files.
> fix lint issues introduced in YUNIKORN-170
> ------------------------------------------
>
> Key: YUNIKORN-263
> URL: https://issues.apache.org/jira/browse/YUNIKORN-263
> Project: Apache YuniKorn
> Issue Type: Bug
> Components: shim - kubernetes
> Affects Versions: 0.9
> Reporter: Wilfred Spiegelenburg
> Assignee: Ting Yao,Huang
> Priority: Major
> Labels: newbie, pull-request-available
>
> The application CRD is a mixture of generated and written code. We do not
> want to lint the generated code as that would give false the wrong impression
> and we really do not want (or can) fix the generated code.
> Propose to add the option {{--skip-dirs pkg/client}} to the lint run to not
> check the directory but I am not sure if all the code is generated in that
> dir.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]