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

Run lint (Python, Go) as a presubmit test #53

Closed
jlewi opened this issue Oct 17, 2017 · 11 comments
Closed

Run lint (Python, Go) as a presubmit test #53

jlewi opened this issue Oct 17, 2017 · 11 comments

Comments

@jlewi
Copy link
Contributor

jlewi commented Oct 17, 2017

We should run lint checks as a presubmit test.

Would be nice to do markdown as well but I'm not sure if there's a linter for markdown.

@jlewi
Copy link
Contributor Author

jlewi commented Oct 26, 2017

Looks like kubernetes/test-infra is getting rid of using Travis so we should probably do the same.

Travis is choking try to install pylint.

@jlewi
Copy link
Contributor Author

jlewi commented Oct 26, 2017

In Travis I tried installing pylint as an apt package but that pulls in an older version 1.0 versus 1.7.

jlewi added a commit that referenced this issue Oct 27, 2017
Add a python lint check
   Partial fix to #53

Capture stdout/stderr of the test and upload to GCS so we have a proper build log that outlives the pod lifetime.
  Fixes #82

* Run autopep8 on all py files.

* Fix python lint issues

* pylintrc was copied from kuberntes/test-infra

* Disable import-error message since some py files run inside containers
which will have different libraries then the machine running the lint check.
@jlewi
Copy link
Contributor Author

jlewi commented Nov 5, 2017

golint is the go linter.

We should add it to lint.sh

I ran it and there are quite a few lint issues:

golint -set_exit_status ./pkg/...
pkg/controller/controller.go:1:1: package comment should be of the form "Package controller ..."
pkg/controller/controller.go:31:2: exported var ErrVersionOutdated should have comment or be unexported
pkg/controller/controller.go:35:2: comment on exported var KubeHttpCli should be of the form "KubeHttpCli ..."
pkg/controller/controller.go:37:2: var KubeHttpCli should be KubeHTTPCli
pkg/controller/controller.go:41:6: exported type Event should have comment or be unexported
pkg/controller/controller.go:46:6: exported type Controller should have comment or be unexported
pkg/controller/controller.go:49:2: struct field ApiCli should be APICli
pkg/controller/controller.go:63:1: exported function New should have comment or be unexported
pkg/controller/controller.go:80:1: exported method Controller.Run should have comment or be unexported
pkg/garbagecollection/gc.go:28:2: exported const NullUID should have comment (or a comment on this block) or be unexported
pkg/garbagecollection/gc.go:31:6: exported type GC should have comment or be unexported
pkg/garbagecollection/gc.go:37:1: exported function New should have comment or be unexported
pkg/spec/controller.go:3:6: exported type ControllerConfig should have comment or be unexported
pkg/spec/controller.go:21:6: exported type AcceleratorConfig should have comment or be unexported
pkg/spec/controller.go:26:6: exported type EnvironmentVariableConfig should have comment or be unexported
pkg/spec/register.go:10:3: exported var SchemeBuilder should have comment or be unexported
pkg/spec/tf_job.go:16:2: exported const CRDKind should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:21:2: comment on exported const AppLabel should be of the form "AppLabel ..."
pkg/spec/tf_job.go:24:2: comment on exported const TfPort should be of the form "TfPort ..."
pkg/spec/tf_job.go:29:1: exported function CRDName should have comment or be unexported
pkg/spec/tf_job.go:33:6: exported type TfJob should have comment or be unexported
pkg/spec/tf_job.go:40:1: exported method TfJob.AsOwner should have comment or be unexported
pkg/spec/tf_job.go:53:1: comment on exported type TfJobSpec should be of the form "TfJobSpec ..." (with optional leading article)
pkg/spec/tf_job.go:56:2: struct field RuntimeId should be RuntimeID
pkg/spec/tf_job.go:73:2: exported const MASTER should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:82:2: exported const TENSORFLOW should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:86:1: comment on exported type TfReplicaSpec should be of the form "TfReplicaSpec ..." (with optional leading article)
pkg/spec/tf_job.go:103:6: exported type TensorBoardSpec should have comment or be unexported
pkg/spec/tf_job.go:125:22: error strings should not be capitalized or end with punctuation or a newline
pkg/spec/tf_job.go:169:16: should omit 2nd value from range; this loop is equivalent to `for name := range ...`
pkg/spec/tf_job.go:273:6: exported type TfJobPhase should have comment or be unexported
pkg/spec/tf_job.go:276:2: exported const TfJobPhaseNone should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:284:6: exported type TfJobCondition should have comment or be unexported
pkg/spec/tf_job.go:292:6: exported type TfJobConditionType should have comment or be unexported
pkg/spec/tf_job.go:308:6: exported type State should have comment or be unexported
pkg/spec/tf_job.go:311:2: exported const StateUnknown should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:317:6: exported type TfJobStatus should have comment or be unexported
pkg/spec/tf_job.go:336:6: exported type ReplicaState should have comment or be unexported
pkg/spec/tf_job.go:339:2: exported const ReplicaStateUnknown should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:346:6: exported type TfReplicaStatus should have comment or be unexported
pkg/spec/tf_job.go:355:1: comment on exported method TfJobStatus.Copy should be of the form "Copy ..."
pkg/spec/tf_job.go:370:1: exported method TfJobStatus.IsFailed should have comment or be unexported
pkg/spec/tf_job.go:377:1: exported method TfJobStatus.SetPhase should have comment or be unexported
pkg/spec/tf_job.go:381:1: exported method TfJobStatus.PauseControl should have comment or be unexported
pkg/spec/tf_job.go:385:1: exported method TfJobStatus.Control should have comment or be unexported
pkg/spec/tf_job.go:389:1: exported method TfJobStatus.SetReason should have comment or be unexported
pkg/spec/tf_job.go:393:1: exported method TfJobStatus.SetState should have comment or be unexported
pkg/spec/tf_job.go:397:1: comment on exported method TfJobStatus.AppendScalingDownCondition should be of the form "AppendScalingDownCondition ..."
pkg/spec/tf_job.go:407:1: exported method TfJobStatus.AppendRecoveringCondition should have comment or be unexported
pkg/spec/tf_job.go:415:1: exported method TfJobStatus.AppendUpgradingCondition should have comment or be unexported
pkg/spec/tf_job.go:426:1: exported method TfJobStatus.AppendRemovingDeadMember should have comment or be unexported
pkg/spec/tf_job.go:437:1: exported method TfJobStatus.SetReadyCondition should have comment or be unexported
pkg/spec/tf_job_list.go:25:6: exported type TfJobListCopy should have comment or be unexported
pkg/spec/tf_job_list.go:26:6: exported type TfJobCopy should have comment or be unexported
pkg/spec/tf_job_list.go:28:1: exported method TfJob.UnmarshalJSON should have comment or be unexported
pkg/spec/tf_job_list.go:39:1: exported method TfJobList.UnmarshalJSON should have comment or be unexported
pkg/trainer/replicas.go:36:1: comment on exported type TFReplicaSetInterface should be of the form "TFReplicaSetInterface ..." (with optional leading article)
pkg/trainer/replicas.go:43:1: comment on exported type TfConfig should be of the form "TfConfig ..." (with optional leading article)
pkg/trainer/replicas.go:55:1: exported function NewTFReplicaSet should have comment or be unexported
pkg/trainer/replicas.go:61:26: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:65:26: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:124:1: exported method TFReplicaSet.Create should have comment or be unexported
pkg/trainer/replicas.go:181:54: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:196:3: var tfConfigJson should be tfConfigJSON
pkg/trainer/replicas.go:235:10: should omit 2nd value from range; this loop is equivalent to `for i := range ...`
pkg/trainer/replicas.go:260:54: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:269:1: error should be the last type when returning multiple items
pkg/trainer/replicas.go:408:1: comment on exported method TFReplicaSet.GetStatus should be of the form "GetStatus ..."
pkg/trainer/tensorboard.go:19:7: exported const TbPort should have comment or be unexported
pkg/trainer/tensorboard.go:28:1: exported function NewTBReplicaSet should have comment or be unexported
pkg/trainer/tensorboard.go:40:1: exported method TBReplicaSet.Create should have comment or be unexported
pkg/trainer/tensorboard.go:108:1: exported method TBReplicaSet.Delete should have comment or be unexported
pkg/trainer/tensorboard.go:173:1: exported method TBReplicaSet.Labels should have comment or be unexported
pkg/trainer/training.go:1:1: package comment should be of the form "Package trainer ..."
pkg/trainer/training.go:44:1: comment on exported type TrainingJob should be of the form "TrainingJob ..." (with optional leading article)
pkg/trainer/training.go:78:6: exported type TaskSpec should have comment or be unexported
pkg/trainer/training.go:106:1: exported function NewJob should have comment or be unexported
pkg/trainer/training.go:133:1: exported method TrainingJob.ClusterSpec should have comment or be unexported
pkg/trainer/training.go:201:1: exported method TrainingJob.GetStatus should have comment or be unexported
pkg/trainer/training.go:360:1: exported method TrainingJob.Delete should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:26:1: exported function MustNewKubeClient should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:34:1: exported function MustNewApiExtensionsClient should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:34:6: func MustNewApiExtensionsClient should be MustNewAPIExtensionsClient
pkg/util/k8sutil/k8sutil.go:42:1: comment on exported function InClusterConfig should be of the form "InClusterConfig ..."
pkg/util/k8sutil/k8sutil.go:66:1: exported function IsKubernetesResourceAlreadyExistError should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:70:1: exported function IsKubernetesResourceNotFoundError should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:74:1: comment on exported function JobListOpt should be of the form "JobListOpt ..."
pkg/util/k8sutil/k8sutil.go:81:1: exported function LabelsForJob should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:89:1: comment on exported function CascadeDeleteOptions should be of the form "CascadeDeleteOptions ..."
pkg/util/k8sutil/tpr_util.go:31:1: comment on exported type TfJobClient should be of the form "TfJobClient ..." (with optional leading article)
pkg/util/k8sutil/tpr_util.go:51:1: exported function NewTfJobClient should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:72:1: comment on exported method TfJobRestClient.Client should be of the form "Client ..."
pkg/util/k8sutil/tpr_util.go:77:1: exported method TfJobRestClient.Watch should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:82:1: exported method TfJobRestClient.List should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:99:1: exported method TfJobRestClient.Create should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:111:1: exported method TfJobRestClient.Get should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:119:1: exported method TfJobRestClient.Update should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:130:1: exported method TfJobRestClient.Delete should have comment or be unexported
pkg/util/k8sutil/election/election.go:66:2: exported const JitterFactor should have comment (or a comment on this block) or be unexported
pkg/util/k8sutil/election/election.go:72:1: comment on exported function NewLeaderElector should be of the form "NewLeaderElector ..."
pkg/util/k8sutil/election/election.go:81:26: error strings should not be capitalized or end with punctuation or a newline
pkg/util/k8sutil/election/election.go:88:6: exported type LeaderElectionConfig should have comment or be unexported
pkg/util/k8sutil/election/election.go:267:1: receiver name l should be consistent with previous receiver name le for LeaderElector
pkg/util/k8sutil/election/resourcelock/endpointslock.go:29:6: exported type EndpointsLock should have comment or be unexported
pkg/util/k8sutil/election/resourcelock/endpointslock.go:38:1: exported method EndpointsLock.Get should have comment or be unexported
pkg/util/k8sutil/election/resourcelock/endpointslock.go:100:1: comment on exported method EndpointsLock.Identity should be of the form "Identity ..."
pkg/util/k8sutil/election/resourcelock/interface.go:25:2: exported const LeaderElectionRecordAnnotationKey should have comment (or a comment on this block) or be unexported
pkg/util/k8sutil/election/resourcelock/interface.go:42:6: type name will be used as resourcelock.ResourceLockConfig by other packages, and that stutters; consider calling this Config
pkg/util/k8sutil/fake/fake.go:1:1: package comment should be of the form "Package fake ..."
pkg/util/k8sutil/fake/fake.go:10:6: exported type TfJobClientFake should have comment or be unexported
pkg/util/k8sutil/fake/fake.go:12:1: exported method TfJobClientFake.Get should have comment or be unexported
pkg/util/k8sutil/fake/fake.go:16:1: exported method TfJobClientFake.List should have comment or be unexported
pkg/util/retryutil/retry_util.go:8:6: exported type RetryError should have comment or be unexported
pkg/util/retryutil/retry_util.go:16:1: exported function IsRetryFailure should have comment or be unexported
pkg/util/retryutil/retry_util.go:21:6: exported type ConditionFunc should have comment or be unexported
jlewi@jlewi-carbon-glaptop:~/git_training$ golint ./pkg/...
pkg/controller/controller.go:1:1: package comment should be of the form "Package controller ..."
pkg/controller/controller.go:31:2: exported var ErrVersionOutdated should have comment or be unexported
pkg/controller/controller.go:35:2: comment on exported var KubeHttpCli should be of the form "KubeHttpCli ..."
pkg/controller/controller.go:37:2: var KubeHttpCli should be KubeHTTPCli
pkg/controller/controller.go:41:6: exported type Event should have comment or be unexported
pkg/controller/controller.go:46:6: exported type Controller should have comment or be unexported
pkg/controller/controller.go:49:2: struct field ApiCli should be APICli
pkg/controller/controller.go:63:1: exported function New should have comment or be unexported
pkg/controller/controller.go:80:1: exported method Controller.Run should have comment or be unexported
pkg/garbagecollection/gc.go:28:2: exported const NullUID should have comment (or a comment on this block) or be unexported
pkg/garbagecollection/gc.go:31:6: exported type GC should have comment or be unexported
pkg/garbagecollection/gc.go:37:1: exported function New should have comment or be unexported
pkg/spec/controller.go:3:6: exported type ControllerConfig should have comment or be unexported
pkg/spec/controller.go:21:6: exported type AcceleratorConfig should have comment or be unexported
pkg/spec/controller.go:26:6: exported type EnvironmentVariableConfig should have comment or be unexported
pkg/spec/register.go:10:3: exported var SchemeBuilder should have comment or be unexported
pkg/spec/tf_job.go:16:2: exported const CRDKind should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:21:2: comment on exported const AppLabel should be of the form "AppLabel ..."
pkg/spec/tf_job.go:24:2: comment on exported const TfPort should be of the form "TfPort ..."
pkg/spec/tf_job.go:29:1: exported function CRDName should have comment or be unexported
pkg/spec/tf_job.go:33:6: exported type TfJob should have comment or be unexported
pkg/spec/tf_job.go:40:1: exported method TfJob.AsOwner should have comment or be unexported
pkg/spec/tf_job.go:53:1: comment on exported type TfJobSpec should be of the form "TfJobSpec ..." (with optional leading article)
pkg/spec/tf_job.go:56:2: struct field RuntimeId should be RuntimeID
pkg/spec/tf_job.go:73:2: exported const MASTER should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:82:2: exported const TENSORFLOW should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:86:1: comment on exported type TfReplicaSpec should be of the form "TfReplicaSpec ..." (with optional leading article)
pkg/spec/tf_job.go:103:6: exported type TensorBoardSpec should have comment or be unexported
pkg/spec/tf_job.go:125:22: error strings should not be capitalized or end with punctuation or a newline
pkg/spec/tf_job.go:169:16: should omit 2nd value from range; this loop is equivalent to `for name := range ...`
pkg/spec/tf_job.go:273:6: exported type TfJobPhase should have comment or be unexported
pkg/spec/tf_job.go:276:2: exported const TfJobPhaseNone should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:284:6: exported type TfJobCondition should have comment or be unexported
pkg/spec/tf_job.go:292:6: exported type TfJobConditionType should have comment or be unexported
pkg/spec/tf_job.go:308:6: exported type State should have comment or be unexported
pkg/spec/tf_job.go:311:2: exported const StateUnknown should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:317:6: exported type TfJobStatus should have comment or be unexported
pkg/spec/tf_job.go:336:6: exported type ReplicaState should have comment or be unexported
pkg/spec/tf_job.go:339:2: exported const ReplicaStateUnknown should have comment (or a comment on this block) or be unexported
pkg/spec/tf_job.go:346:6: exported type TfReplicaStatus should have comment or be unexported
pkg/spec/tf_job.go:355:1: comment on exported method TfJobStatus.Copy should be of the form "Copy ..."
pkg/spec/tf_job.go:370:1: exported method TfJobStatus.IsFailed should have comment or be unexported
pkg/spec/tf_job.go:377:1: exported method TfJobStatus.SetPhase should have comment or be unexported
pkg/spec/tf_job.go:381:1: exported method TfJobStatus.PauseControl should have comment or be unexported
pkg/spec/tf_job.go:385:1: exported method TfJobStatus.Control should have comment or be unexported
pkg/spec/tf_job.go:389:1: exported method TfJobStatus.SetReason should have comment or be unexported
pkg/spec/tf_job.go:393:1: exported method TfJobStatus.SetState should have comment or be unexported
pkg/spec/tf_job.go:397:1: comment on exported method TfJobStatus.AppendScalingDownCondition should be of the form "AppendScalingDownCondition ..."
pkg/spec/tf_job.go:407:1: exported method TfJobStatus.AppendRecoveringCondition should have comment or be unexported
pkg/spec/tf_job.go:415:1: exported method TfJobStatus.AppendUpgradingCondition should have comment or be unexported
pkg/spec/tf_job.go:426:1: exported method TfJobStatus.AppendRemovingDeadMember should have comment or be unexported
pkg/spec/tf_job.go:437:1: exported method TfJobStatus.SetReadyCondition should have comment or be unexported
pkg/spec/tf_job_list.go:25:6: exported type TfJobListCopy should have comment or be unexported
pkg/spec/tf_job_list.go:26:6: exported type TfJobCopy should have comment or be unexported
pkg/spec/tf_job_list.go:28:1: exported method TfJob.UnmarshalJSON should have comment or be unexported
pkg/spec/tf_job_list.go:39:1: exported method TfJobList.UnmarshalJSON should have comment or be unexported
pkg/trainer/replicas.go:36:1: comment on exported type TFReplicaSetInterface should be of the form "TFReplicaSetInterface ..." (with optional leading article)
pkg/trainer/replicas.go:43:1: comment on exported type TfConfig should be of the form "TfConfig ..." (with optional leading article)
pkg/trainer/replicas.go:55:1: exported function NewTFReplicaSet should have comment or be unexported
pkg/trainer/replicas.go:61:26: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:65:26: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:124:1: exported method TFReplicaSet.Create should have comment or be unexported
pkg/trainer/replicas.go:181:54: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:196:3: var tfConfigJson should be tfConfigJSON
pkg/trainer/replicas.go:235:10: should omit 2nd value from range; this loop is equivalent to `for i := range ...`
pkg/trainer/replicas.go:260:54: error strings should not be capitalized or end with punctuation or a newline
pkg/trainer/replicas.go:269:1: error should be the last type when returning multiple items
pkg/trainer/replicas.go:408:1: comment on exported method TFReplicaSet.GetStatus should be of the form "GetStatus ..."
pkg/trainer/tensorboard.go:19:7: exported const TbPort should have comment or be unexported
pkg/trainer/tensorboard.go:28:1: exported function NewTBReplicaSet should have comment or be unexported
pkg/trainer/tensorboard.go:40:1: exported method TBReplicaSet.Create should have comment or be unexported
pkg/trainer/tensorboard.go:108:1: exported method TBReplicaSet.Delete should have comment or be unexported
pkg/trainer/tensorboard.go:173:1: exported method TBReplicaSet.Labels should have comment or be unexported
pkg/trainer/training.go:1:1: package comment should be of the form "Package trainer ..."
pkg/trainer/training.go:44:1: comment on exported type TrainingJob should be of the form "TrainingJob ..." (with optional leading article)
pkg/trainer/training.go:78:6: exported type TaskSpec should have comment or be unexported
pkg/trainer/training.go:106:1: exported function NewJob should have comment or be unexported
pkg/trainer/training.go:133:1: exported method TrainingJob.ClusterSpec should have comment or be unexported
pkg/trainer/training.go:201:1: exported method TrainingJob.GetStatus should have comment or be unexported
pkg/trainer/training.go:360:1: exported method TrainingJob.Delete should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:26:1: exported function MustNewKubeClient should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:34:1: exported function MustNewApiExtensionsClient should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:34:6: func MustNewApiExtensionsClient should be MustNewAPIExtensionsClient
pkg/util/k8sutil/k8sutil.go:42:1: comment on exported function InClusterConfig should be of the form "InClusterConfig ..."
pkg/util/k8sutil/k8sutil.go:66:1: exported function IsKubernetesResourceAlreadyExistError should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:70:1: exported function IsKubernetesResourceNotFoundError should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:74:1: comment on exported function JobListOpt should be of the form "JobListOpt ..."
pkg/util/k8sutil/k8sutil.go:81:1: exported function LabelsForJob should have comment or be unexported
pkg/util/k8sutil/k8sutil.go:89:1: comment on exported function CascadeDeleteOptions should be of the form "CascadeDeleteOptions ..."
pkg/util/k8sutil/tpr_util.go:31:1: comment on exported type TfJobClient should be of the form "TfJobClient ..." (with optional leading article)
pkg/util/k8sutil/tpr_util.go:51:1: exported function NewTfJobClient should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:72:1: comment on exported method TfJobRestClient.Client should be of the form "Client ..."
pkg/util/k8sutil/tpr_util.go:77:1: exported method TfJobRestClient.Watch should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:82:1: exported method TfJobRestClient.List should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:99:1: exported method TfJobRestClient.Create should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:111:1: exported method TfJobRestClient.Get should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:119:1: exported method TfJobRestClient.Update should have comment or be unexported
pkg/util/k8sutil/tpr_util.go:130:1: exported method TfJobRestClient.Delete should have comment or be unexported
pkg/util/k8sutil/election/election.go:66:2: exported const JitterFactor should have comment (or a comment on this block) or be unexported
pkg/util/k8sutil/election/election.go:72:1: comment on exported function NewLeaderElector should be of the form "NewLeaderElector ..."
pkg/util/k8sutil/election/election.go:81:26: error strings should not be capitalized or end with punctuation or a newline
pkg/util/k8sutil/election/election.go:88:6: exported type LeaderElectionConfig should have comment or be unexported
pkg/util/k8sutil/election/election.go:267:1: receiver name l should be consistent with previous receiver name le for LeaderElector
pkg/util/k8sutil/election/resourcelock/endpointslock.go:29:6: exported type EndpointsLock should have comment or be unexported
pkg/util/k8sutil/election/resourcelock/endpointslock.go:38:1: exported method EndpointsLock.Get should have comment or be unexported
pkg/util/k8sutil/election/resourcelock/endpointslock.go:100:1: comment on exported method EndpointsLock.Identity should be of the form "Identity ..."
pkg/util/k8sutil/election/resourcelock/interface.go:25:2: exported const LeaderElectionRecordAnnotationKey should have comment (or a comment on this block) or be unexported
pkg/util/k8sutil/election/resourcelock/interface.go:42:6: type name will be used as resourcelock.ResourceLockConfig by other packages, and that stutters; consider calling this Config
pkg/util/k8sutil/fake/fake.go:1:1: package comment should be of the form "Package fake ..."
pkg/util/k8sutil/fake/fake.go:10:6: exported type TfJobClientFake should have comment or be unexported
pkg/util/k8sutil/fake/fake.go:12:1: exported method TfJobClientFake.Get should have comment or be unexported
pkg/util/k8sutil/fake/fake.go:16:1: exported method TfJobClientFake.List should have comment or be unexported
pkg/util/retryutil/retry_util.go:8:6: exported type RetryError should have comment or be unexported
pkg/util/retryutil/retry_util.go:16:1: exported function IsRetryFailure should have comment or be unexported
pkg/util/retryutil/retry_util.go:21:6: exported type ConditionFunc should have comment or be unexported

@jimexist
Copy link
Member

jimexist commented Nov 8, 2017

using gometalinter and disabling comment related lint warnings could be a starter

jlewi added a commit that referenced this issue Nov 22, 2017
Create a binary to run pylint and python unittests.

This will be used in our E2E test pipeline.

Partial fix to #126 (lint results not reported in gubernator)

This binary creates junit files with junit files
Partial fix to #53 (run pylint as a presubmit)

This provides a binary to run lint that will be incorporated into our E2E pipeline.
Partial fix to #101 (run python unittests as part of pre/post submit)

This PR provides a binary to run the unittests; subsequent PR will integrate it into Airflow.
jlewi added a commit that referenced this issue Nov 25, 2017
* Create a binary to run python lint and unittests .

* This will be used to run lint and unittests as part of the E2E pipeline.

* Integrate python lint and unittests into our E2E pipeline.

* Update the deployment.

* Fix #126 (lint results not reported in gubernator)
* Fix #53 (run pylint as a presubmit)
* Fix #101 (run python unittests as part of pre/post submit)

* To support this change we modify our Airflow E2E pipeline so that it will checkout the source to a directory that is on our PD and passes that directory to subsequent steps via XCom.
@jlewi jlewi reopened this Dec 28, 2017
@jimexist
Copy link
Member

jimexist commented Dec 29, 2017

@jlewi see also #248 and one can add pylint as a dev dependency there

@jimexist
Copy link
Member

@jewi

Would be nice to do markdown as well but I'm not sure if there's a linter for markdown.

Prettier can handle markdown

@jimexist
Copy link
Member

also FYI pipenv can enforce pep8 check

jlewi pushed a commit that referenced this issue Dec 29, 2017
and gradually tighten the linting rules. for now unused and golint are left out.

some fixes are included in this PR.

using gometaliner instead of just golint because:

it covers more cases, e.g. the typo checkings.
it also allows for disabling rules w.r.t regex, e.g. when you don't want to enforce all the comment rules enforced by golint

* Part of #53
@jlewi
Copy link
Contributor Author

jlewi commented Feb 1, 2018

So I think the additional work items are

  • enforce pep8 check using pipenv
  • use prettier for markdown checks

py lint checks are performed by running py scripts using prow.
go lint checks are performed by running gometaliner using Travis

My preference over time would be to do everything using prow. So when we add more checks lets do it by using prow.

@stale
Copy link

stale bot commented Apr 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@jlewi
Copy link
Contributor Author

jlewi commented Apr 21, 2020

@johnugeorge @richardsliu is this still relevant? Did we ever setup lint checks?

@stale stale bot removed the lifecycle/stale label Apr 21, 2020
@johnugeorge
Copy link
Member

@jlewi jlewi closed this as completed Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants