Documentation Issue
Compose has a specific coding style guide but it isn't directly documented.
Recommended change
Make a STYLE.md file that concisely provides the coding style that is required by all Compose code. Update existing documentation to tell contributors to follow the style guide.
Additional Context
The style guide can be derived from the ERC721Facet.sol and LibERC721.sol, and ERC20Facet.sol and LibERC20.sol files.
The style guild should concisely give rules and examples of rules as needed to make it clear.
Here are some points that should be included in the style guide:
- All parameters names to events, errors and functions should be preceded with an underscore "_".
- One line if statements without code block brackets "{" and "}" are not allowed. Use a newline and brackets.
- Internal functions in facets should be preceded with "internal". Note: There should be none or few internal functions in facets. Repeat yourself if it makes the code easier to follow or read.
- Internal functions in Solidity libraries are not proceeded with anything, since, in Compose, all functions in libraries are internal functions.
- Use
delete to set a value to 0.
- Use camel case for names of variables and functions and contract and library names unless parts of it are usually uppercase like ERC.
- The formatting of code is determined by the default settings of
forge fmt. Run forge fmt to format your code.
Tell users to look at ERC721Facet.sol and LibERC721.sol for more examples of the style guide.
More rules can be derived from the above mentioned source code files.
Helpful Information
Have a question? Please check our CONTRIBUTING file first - your answer might already be there!
Want to discuss something? For general questions, ideas, or brainstorming, please browse our discussions or start a new one.
You can also join our Discord to discuss the documentation issue.
Documentation Issue
Compose has a specific coding style guide but it isn't directly documented.
Recommended change
Make a STYLE.md file that concisely provides the coding style that is required by all Compose code. Update existing documentation to tell contributors to follow the style guide.
Additional Context
The style guide can be derived from the
ERC721Facet.solandLibERC721.sol, andERC20Facet.solandLibERC20.solfiles.The style guild should concisely give rules and examples of rules as needed to make it clear.
Here are some points that should be included in the style guide:
deleteto set a value to 0.forge fmt. Runforge fmtto format your code.Tell users to look at
ERC721Facet.solandLibERC721.solfor more examples of the style guide.More rules can be derived from the above mentioned source code files.
Helpful Information
Have a question? Please check our CONTRIBUTING file first - your answer might already be there!
Want to discuss something? For general questions, ideas, or brainstorming, please browse our discussions or start a new one.
You can also join our Discord to discuss the documentation issue.