You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new version of Prettier Solidity changes a few things about how it formats the code, so this PR includes many small changes to formatting.
I wrote a little program to check that files in this PR didn't change in their actual Solidity content, other than comments and whitespace: solidity-fingerprint.
there are a few scenarios where prettier-plugin-solidity changes the code to improve readability. However we make sure these changes don't affect the compiled code.
For example a * b / c will be formatted as (a * b) / c or a ** b ** c will result in a ** (b ** c).
these changes will generate a different fingerprint in your program since we added () but the compiled code will be the same.
So in the future, when we release a new version, you might want to consider comparing compiled codes instead.
@Janther The issue is that things like abstract contracts don't produce bytecode. But you're right that the fingerprint as I defined it here is not the right approach. Instead of computing a fingerprint of the token stream, it should probably be of the AST.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new version of Prettier Solidity changes a few things about how it formats the code, so this PR includes many small changes to formatting.
I wrote a little program to check that files in this PR didn't change in their actual Solidity content, other than comments and whitespace: solidity-fingerprint.