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

chore: add solidity formatter #1247

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

enitrat
Copy link
Collaborator

@enitrat enitrat commented Jul 1, 2024

Time spent on this PR: 0.5h

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Resolves #1244

What is the new behavior?


This change is Reviewable

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.40%. Comparing base (74ea1ee) to head (abcc68d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1247      +/-   ##
==========================================
- Coverage   65.47%   65.40%   -0.08%     
==========================================
  Files          49       49              
  Lines        8281     8281              
==========================================
- Hits         5422     5416       -6     
- Misses       2859     2865       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@obatirou
Copy link
Collaborator

obatirou commented Jul 1, 2024

Realizing that some external contracts are copy/pasted for tests in the src directory, solmate and uniswapV2 among others, and this PR change their code. It should be avoided if possible.
A new issue should be created to import those as dependencies in forge to avoid formatting those contracts or introducing regressions accidentally. Maybe even do this before introducing the formatter ?
Not sure what are the implication of this and what impact it would have on how the tests are constructed with python if imported with forge.

One solution in the meantime to avoid applying the forge fmt to them is to use the ignore for forge fmt.
If those contracts are kept copy / paste in the end, a commit hash of original repo should be associated to track them if possible.

@ClementWalter
Copy link
Member

@enitrat should we just ignore or upgrade to have these files as submodule?
I suggest

  1. ignore and merge this
  2. create an issue to have submodules

@enitrat
Copy link
Collaborator Author

enitrat commented Jul 2, 2024

Let's go with 1. as this is low priority and impact

@enitrat
Copy link
Collaborator Author

enitrat commented Jul 2, 2024

@obatirou did you find any info on why uint -> uint256 ended up making the test fail?

@obatirou
Copy link
Collaborator

obatirou commented Jul 2, 2024

@obatirou did you find any info on why uint -> uint256 ended up making the test fail?

Unfortunately no, will try again this week

@ClementWalter ClementWalter merged commit fc867c0 into main Jul 2, 2024
8 of 9 checks passed
@ClementWalter ClementWalter deleted the chore/solidity-formatter branch July 2, 2024 14:39
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.

style: add a solidity formatter
3 participants