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

Part of: Lint Go Code #49 #223

Merged
merged 11 commits into from
Jun 7, 2021
Merged

Part of: Lint Go Code #49 #223

merged 11 commits into from
Jun 7, 2021

Conversation

AdrK
Copy link
Contributor

@AdrK AdrK commented May 29, 2021

No description provided.

@github-actions github-actions bot requested review from petethepig and Rperry2174 May 29, 2021 19:05
@AdrK AdrK linked an issue May 29, 2021 that may be closed by this pull request
@AdrK AdrK changed the title Lint Closes: Lint Go Code #49 May 29, 2021
@AdrK AdrK changed the title Closes: Lint Go Code #49 Part of: Lint Go Code #49 May 29, 2021
@codecov
Copy link

codecov bot commented May 29, 2021

Codecov Report

Merging #223 (05fcd34) into main (2cc5f0e) will increase coverage by 0.66%.
The diff coverage is 71.22%.

❗ Current head 05fcd34 differs from pull request most recent head f44db73. Consider uploading reports for the commit f44db73 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   56.07%   56.73%   +0.66%     
==========================================
  Files          74       73       -1     
  Lines        3089     2990      -99     
==========================================
- Hits         1732     1696      -36     
+ Misses       1186     1142      -44     
+ Partials      171      152      -19     
Impacted Files Coverage Δ
pkg/agent/gospy/gospy.go 22.59% <0.00%> (+0.36%) ⬆️
pkg/agent/session.go 63.20% <ø> (ø)
pkg/analytics/analytics.go 84.06% <ø> (ø)
pkg/storage/dimension/serialization.go 0.00% <0.00%> (ø)
pkg/storage/segment/debug_vis.go 25.00% <0.00%> (ø)
pkg/storage/segment/serialization.go 75.59% <0.00%> (+1.72%) ⬆️
pkg/storage/storage.go 71.36% <0.00%> (+8.36%) ⬆️
pkg/util/caps/capabilities.go 0.00% <ø> (ø)
pkg/util/debug/disk.go 0.00% <0.00%> (ø)
pkg/util/bytesize/bytesize.go 40.00% <20.00%> (ø)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2cc5f0e...f44db73. Read the comment docs.

@AdrK AdrK removed a link to an issue May 29, 2021
@AdrK AdrK mentioned this pull request May 29, 2021
@petethepig
Copy link
Member

I like that you separated commits by package. We should not lint pkg/agent/pprof/ package (and we should actually add it to some exclude list) because it's copied from golang source code and if we don't it's gonna get messy if we ever want to pull the changes from upstream.

@@ -6,21 +6,21 @@ import (
"sync"
)

type key []byte
Copy link
Member

Choose a reason for hiding this comment

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

why make this one public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intersection() is a public method which returns an array of items of Key type which itself is not public.

@@ -60,15 +60,15 @@ func New() *Tree {
}
}

func (dstTrie *Tree) Merge(srcTrieI merge.Merger) {
Copy link
Member

@petethepig petethepig May 31, 2021

Choose a reason for hiding this comment

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

I know the linter says these names should be consistent (actually, I couldn't find the rule that enforces this), but I kinda feel in this particular case it's useful to have this src / dst distinction.

What do you all think about this? @AdrK @kolesnikovae

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would go with consistent approach. Reader of this file should quickly learn what t stands for. Also, naming as dstTree and srcTree might suggests that both those vars came as an arguments and this method can work on two arbitrary trees, while it can only merge a tree provided by argument with itself and t denotes it ( like self in Python ).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, good points, I think I'm in favor of t now

Copy link
Member

@petethepig petethepig left a comment

Choose a reason for hiding this comment

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

Looks good. I added a couple of comments. We should definitely add agent/pprof to the list of exceptions

Copy link
Member

@petethepig petethepig left a comment

Choose a reason for hiding this comment

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

LGTM

@petethepig petethepig merged commit 880e06a into main Jun 7, 2021
@petethepig petethepig deleted the lint branch June 7, 2021 23:34
korniltsev pushed a commit that referenced this pull request Jul 18, 2023
Datasource: Add query type switch
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