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

accounts/abi/bind: keep test file package name consistent #29816

Closed
wants to merge 1 commit into from

Conversation

hattizai
Copy link
Contributor

This PR adds some small code cleanup:

  • accounts/abi/bind: keep test file package name consistent
  • common: sort variables to make code more clear
  • core: remove redundant type declaration

common: sort variables to make code more clear
core: remove redundant type declaration
Copy link

@sara554-beep sara554-beep left a comment

Choose a reason for hiding this comment

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

Nose utilizar la aplicación ni como poder hacer cambios

@hattizai
Copy link
Contributor Author

Nose utilizar la aplicación ni como poder hacer cambios

Please stop your spam

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

Yeah, it's indeed inconsistent.

Although, normally we use the same package name for tests, but I think it should be fine to use bind_test here. Using bind for tests could result in a larger diff then.

@AaronChen0
Copy link
Contributor

There are many cases like this, if you run

find . -name "*test.go" | xargs grep '^package'

@hattizai
Copy link
Contributor Author

There are many cases like this, if you run

find . -name "*test.go" | xargs grep '^package'

@AaronChen0 I'm sorry, but the output of the script is a mess, did you mean that all the test file in the output has the same issue? Could you please check the script again?

@AaronChen0
Copy link
Contributor

Your idea is to put the tests into a separate test package, right?
But most *test.go files have this inconsistency. Should we change them all?
A grep command with color output

grep --include=*test.go -R '^package'

@hattizai
Copy link
Contributor Author

hattizai commented May 23, 2024

Nope, I think it's ok to just keep the test file package consistent under the same folder, no matter {package} or {package_test}

I did some statistics just now, all the folders that contain inconsistent test package names are the following:

  • accounts/abi/bind
  • common/hexutil/
  • core/types/
  • core/vm/runtime/
  • event/
  • node/
  • rlp/
  • rpc/
  • signer/core

This touches a lot of packages, maybe I should split it into multiple PRs.

@rjl493456442 Sir, what do you think of this? Shall we rename all {package_test} to {package} or just depends on the diff changes of {package_test} => {package} and {package} => {package_test} under each folder

@fjl
Copy link
Contributor

fjl commented May 23, 2024

We will leave the package names as they are. The tests are working.

@fjl fjl closed this May 23, 2024
@fjl fjl removed the status:triage label May 23, 2024
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.

5 participants