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

Add funcorder linter #4939

Merged
merged 3 commits into from
Aug 11, 2022
Merged

Conversation

shijiesheng
Copy link
Member

What changed?

We need to sort the order of access methods in preparation for add codegen components. So I wrote a simple ast-based linter that automatically scan through the package and apply the changes.

Why?

How did you test it?

Potential risks

Release notes

Documentation Changes

@shijiesheng shijiesheng force-pushed the reorder branch 2 times, most recently from 58554de to d695ffe Compare August 11, 2022 18:04
"golang.org/x/tools/go/analysis/singlechecker"
)

func main() {
Copy link
Member

Choose a reason for hiding this comment

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

How is the tool used? Do we need to run it manually? Do we need to pass the file we want to fix?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently it's a script that runs manually. go run main.go will output the command line.

Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing this isn't hooked into the make lint step yet? should that be done?

Copy link
Member

Choose a reason for hiding this comment

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

ah. and we should probably move this to internal/tools/go.mod

@shijiesheng shijiesheng enabled auto-merge (squash) August 11, 2022 20:29
@shijiesheng shijiesheng merged commit b21f34f into cadence-workflow:master Aug 11, 2022
@coveralls
Copy link

Pull Request Test Coverage Report for Build 01828f1b-1b7d-4948-b461-b6411d1ae88e

  • 0 of 289 (0.0%) changed or added relevant lines in 3 files are covered.
  • 105 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.01%) to 57.665%

Changes Missing Coverage Covered Lines Changed/Added Lines %
client/frontend/client.go 0 52 0.0%
client/frontend/metricClient.go 0 105 0.0%
client/frontend/errorInjectionClient.go 0 132 0.0%
Files with Coverage Reduction New Missed Lines %
common/task/parallelTaskProcessor.go 2 92.75%
client/frontend/client.go 3 2.64%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 3 57.44%
common/persistence/statsComputer.go 3 93.57%
common/persistence/serialization/parser.go 4 62.41%
common/persistence/serialization/thrift_decoder.go 4 53.06%
service/history/task/transfer_standby_task_executor.go 4 86.26%
common/persistence/sql/workflowStateMaps.go 12 81.25%
service/history/execution/mutable_state_task_refresher.go 14 62.03%
common/persistence/serialization/getters.go 16 57.89%
Totals Coverage Status
Change from base Build 01828e52-7f83-47f1-a0c5-7be2f481eb1f: -0.01%
Covered Lines: 83934
Relevant Lines: 145555

💛 - Coveralls

ZackLK pushed a commit that referenced this pull request Aug 22, 2022
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.

4 participants