6529-Collections / nftdelegation

Delegation contract
MIT License
16 stars 7 forks source link

Version 5.20.3 of the code is very hard to read due to poor indentation #27

Closed rookmate closed 1 year ago

rookmate commented 1 year ago

The indentation of the current code makes it very hard to read what is inside each for loop and inside each if else statement.

I think it would improve the quality of the code if it was indented correctly as it would also make it more readable. I will open a PR for this version.

EDIT: There is also a lack of consistency on assignments and comparisons. Eg. varible=0 vs variable = 0

I propose to use the C standard. Example 1: variables are to be spaced from operators variable = 0

Example 2: Indentation inside brackets have one additional tab Example 3: Spacing after a closed bracket and conditional or loop

if (something) {
    (...)
}
rookmate commented 1 year ago

See PR #28

rookmate commented 1 year ago

Thoughts? @skyn3t2030 @brookr

brookr commented 1 year ago

Yes! Very important for readability and clarity, and therefore bug reduction.

@skyn3t2030: Do you like this style guide proposal? I'll add that to the contributing guide if so.

skyn3t2030 commented 1 year ago

Guys thanks for your comments. Please allow me some days as I am currently working on a newer version that optimizes the functionality of the smart contract for specific usecases and then we can fix indentation :)

rookmate commented 1 year ago

Ok, so I will drop the PR #28. When you update the code I'll redo it 👍

@skyn3t2030 before you update to the next version, also check my 2 other issues. They are minor updates that are nice to have

skyn3t2030 commented 1 year ago

agree, will do thanks

brookr commented 1 year ago

Could we standardize on using something like Prettier in local dev environments?

We can add one of these to support linting:

brookr commented 1 year ago

Let's close this one, @rookmate, with what has been merged and current PR, we are in good shape!

The hardhat ext in VS Code ("Solidity by Nomic Foundation") provides a formatter and linter. Let's go with that.