-
Notifications
You must be signed in to change notification settings - Fork 73
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
4 spaces indentation #122
4 spaces indentation #122
Conversation
…rmatter should follow the industry.
Codecov Report
@@ Coverage Diff @@
## master #122 +/- ##
=========================================
- Coverage 95.27% 94.5% -0.77%
=========================================
Files 5 5
Lines 254 255 +1
Branches 56 56
=========================================
- Hits 242 241 -1
- Misses 12 14 +2
Continue to review full report at Codecov.
|
I've got no particular preference but I see there are some strange indentations in the snapshots? |
everything that is code related has 4 spaces indentation (I changed these manually before running the tests). Also, snapshots contain the code before and after the format so you might also be looking at the code before the format, which contains different types of indentation (2 spaces, 4 spaces, tabs, etc) and trailing whitespace. |
LGTM. @Janther, can you give an example of some block comment that looks weird after being formatted? |
For example, this is the block before formatting: prettier-plugin-solidity/tests/BasicIterator/__snapshots__/jsfmt.spec.js.snap Lines 36 to 38 in f80a9a8
and after formatting it looks like this: prettier-plugin-solidity/tests/BasicIterator/__snapshots__/jsfmt.spec.js.snap Lines 80 to 82 in f80a9a8
also tabs are kept within these blocks prettier-plugin-solidity/tests/BasicIterator/__snapshots__/jsfmt.spec.js.snap Lines 49 to 51 in f80a9a8
|
trying these out with prettier on javascript, it has the same issue. |
Yeah, the formatting of comments is handled by prettier itself. If the same thing happens in js, I think we can ignore it here. Keeping the tabs seems OK to me: it makes sense to keep the comment's content verbatim. The first example does look wrong though. Maybe you can open an issue in Prettier's repo? |
if we are all happy I'll merge and deploy |
I need to clearly specify `tabWidth: 2` because of this: 4 spaces indentation by Janther · Pull Request #122 · prettier-solidity/prettier-plugin-solidity prettier-solidity/prettier-plugin-solidity#122 --- Original commit (chain-contracts): 87b07af95d503cdd51a64b1c6a6ee078b7fd9525
Solidity industry indents using 4 spaces and this opinionated code formatter should follow the industry.