You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/06/06 01:04:14 UTC

[GitHub] [incubator-devlake] matrixji opened a new pull request, #2084: fix: golangci-lint not works in CI

matrixji opened a new pull request, #2084:
URL: https://github.com/apache/incubator-devlake/pull/2084

   - run golangci-lint in lake-builder to ensure the toolchain is same as builder
   - fix some header missing errors
   - add //nolint and TODO for other errors(4 in total), which we may handle later
   - enable gofmt in golangci-lint and add `make fmt` for format the whole project, this could keep us always with the same style.
   
   fixes: #2077
   
   Signed-off-by: Ji Bin <ma...@live.com>
   
   ### ⚠️ &nbsp;&nbsp;Pre Checklist
   
   > Please complete _ALL_ items in this checklist, and remove before submitting
   
   - [x] I have read through the [Contributing](https://devlake.apache.org/community/) Documentation
   - [x] This PR is using a `label` (bug, feature etc.)
   - [ ] My code is has necessary documentation (if appropriate)
   - [ ] I have added any relevant tests
   - [x] This section (**⚠️ &nbsp;&nbsp;Pre Checklist**) will be removed when submitting PR
   
   # Summary
   
   <!--
   Thanks for submitting a pull request!
   
   We appreciate you spending the time to work on these changes.
   Please fill out as many sections below as possible.
   -->
   
   ### Does this close any open issues?
   #2077 
   
   ### Screenshots
   After this change, the lint jobs got:
   ```
   Running [/github/home/golangci-lint-1.43.0-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
     golangci-lint found no issues
     Ran golangci-lint in 119980ms
   ```
   
   and previously:
   ```
     Running [/home/runner/golangci-lint-1.43.0-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
     level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package git: could not load export data: no export data for \"github.com/libgit2/git2go/v33\""
   
     golangci-lint found no issues
     Ran golangci-lint in 20615ms
   ```
   
   
   ### Other Information
   N/A
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] matrixji commented on a diff in pull request #2084: fix: golangci-lint not works in CI

Posted by GitBox <gi...@apache.org>.
matrixji commented on code in PR #2084:
URL: https://github.com/apache/incubator-devlake/pull/2084#discussion_r889801569


##########
plugins/helper/default_task_context.go:
##########
@@ -188,14 +188,14 @@ func (c *DefaultTaskContext) SubTaskContext(subtask string) (core.SubTaskContext
 	if run, ok := c.subtasks[subtask]; ok {
 		if run {
 			// now, create a sub task context if it didn't exist
-			c.mu.Lock()
+			c.defaultExecContext.mu.Lock()

Review Comment:
   It seems `structcheck`'s bug. It will report:
   > plugins/helper/default_task_context.go:44:2: `mu` is unused (structcheck)
   >        mu       sync.Mutex
   >        ^
   
   
   Maybe we could disable `structcheck `, it only checks unused fields, but it does not support  embedded struct
   
   
   ref: https://gitlab.com/opennota/check#known-limitations
   > structcheck doesn't handle embedded structs yet.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh merged pull request #2084: fix: golangci-lint not works in CI

Posted by GitBox <gi...@apache.org>.
klesh merged PR #2084:
URL: https://github.com/apache/incubator-devlake/pull/2084


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on a diff in pull request #2084: fix: golangci-lint not works in CI

Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #2084:
URL: https://github.com/apache/incubator-devlake/pull/2084#discussion_r889790430


##########
plugins/helper/default_task_context.go:
##########
@@ -188,14 +188,14 @@ func (c *DefaultTaskContext) SubTaskContext(subtask string) (core.SubTaskContext
 	if run, ok := c.subtasks[subtask]; ok {
 		if run {
 			// now, create a sub task context if it didn't exist
-			c.mu.Lock()
+			c.defaultExecContext.mu.Lock()

Review Comment:
   Why change this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org