Comments (8)
Are there any custom rules or are the standard rules okay for this? Also should a linter be added for non-solidity files and if so should the two linters be run through the same script (run lint) or separate scripts(run lint, run solium)?
Is changing the errors flagged through linting included in this issue?
from aragonos.
I'd say to focus on Solidity linting first. The standard rules would be a good point to start.
Maybe we could add JS linting for the test files after
from aragonos.
Alright, I added the solidity linting and got about 90 errors and 500 warnings. I'm totally down to make the changes to pass the linter but don't want to go ahead on that if there are standards that you downright disagree with. I started fixing things that look like outright errors ( " 1 -1" vs " 1 - 1 ") but I'm leaving alone things that appear to be preferences ( opening brace on new line for functions with a returns statement in the function decleration for example ). Also it looks like Solium is throwing errors unrelated to the aragon-core code base. Once I get the warnings down I'll take a look into that and see if that's something that's easily resolved. I pushed just adding Solium which was very straight forward so let me know if you want me to put in a PR for just that, otherwise I'll wait until I clean some of these errors and put a PR in then.
from aragonos.
@Quazia I think it would be neat if you opened to PR even if it's a work in progress. I'd like to know what sort of errors are thrown; could you perhaps include some examples?
from aragonos.
Yeah sure,
if (!holder.send(returningMoney)) throw;
^-- ERROR: Consequent should exist exactly on the line after condition.
These errors are pretty common, this and the 4 space tabs over 2 space tabs are probably two of the most common
function BoundedStandardSale(address _daoAddress, uint8 _tokenId, uint256 _min, uint256 _max, uint256 _price, uint64 _closeDate, string _title) {
^-- WARNING: Function 'BoundedStandardSale': in case of more than 3 parameters, drop each into its own line.
This is one that I think makes sense. I think it's a lot easier to read when they're dropped down.
In /home/quazia/Sites/quazia/aragon-core/contracts/kernel/organs/VaultOrgan.sol, line 321:
modifier check_blacklist(address _token) {
^-- WARNING: 'check_blacklist' doesn't follow the mixedCase notation
I haven't been resolving the mixedCase notation where it's a function name as I don't want to create a breaking change elsewhere. I don't know if the smart solution to this would be to allow snake_case in the linter or to just standardize to mixedCase.
(sig == GET_TOKEN_BALANCE_SIG)||
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
^-- ERROR: There should be no comments between right side and '||'.
I'm having difficulty resolving this one in a way that only changes syntax so I moved past it for the time being, the same error is thrown in all of the canHandlePayload functions across the Organ contracts. In addition, some of the canHandlePayload functions are causing the parser to crash but I've found just adding parentheses seems to resolve the parser errors.
48 errors, 211 warnings found.
I've gotten about half of the errors/warnings handled but I'm sure that as I fix the parser errors more will pop up.
I have a txt file of the lint output if you'd like to take a look and I'm going to put a PR in as a WIP as requested. I'd say the vast majority of warnings and errors fit into one of the categories above.
from aragonos.
Currently there is a parser error for some of the assembly blocks for example:
solidity-parser ./contracts/kernel/organs/ApplicationOrgan.sol
Expected "=:", "hex", "let", "{", "}", comment, end of line, number, string, or whitespace but "r" found. Line: 33, Column: 13
This is due to the following issue in ConsenSys/solidity-parser
"Missing assembly rules: for, switch, function #83"
The parsing issue presents in multiple contracts when a return statement is used in an assembly block.
Going to proceed for the time being and if needed maybe try and resolve this issue in the solidity-parser
from aragonos.
Awesome! Btw, just a heads up, old-contracts
is going to be deleted from the repo, it is just there as a quickly accessible reference
from aragonos.
Linter added in #59.
from aragonos.
Related Issues (20)
- filter argument is ignored in contract pastEvents() HOT 2
- README: add links to last audits
- Add cron-like capabilites HOT 1
- An app published without a name, cannot be upgraded HOT 2
- Pinned an IPFS resource and now cannot upgrade my app locally HOT 5
- Create interface files compatible with solc 0.5 and 0.6
- My app disappeared HOT 9
- ACL: Explore execution times param type
- ACLOracle: update interface to receive `who` properly
- Support for Diamonds HOT 2
- Apps: Create IAragonApp interface
- Initialize: emit event on initialization
- Function name collisions for Aragon Apps
- Get rid of compilation warnings for a good DX
- Possible grave bug in aragonOS HOT 1
- Update existing related packages to their web3 counterparts HOT 1
- Update the master branch HOT 1
- Kernel.newAppInstance should store app instance address address for non default apps as well HOT 1
- Deployment script is missing registration and configuration for open.aragonpm.eth HOT 1
- May I ask how to add snapshot+aragon for binding governance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aragonos.