eth-sri / securify

[DEPRECATED] Security Scanner for Ethereum Smart Contracts
Apache License 2.0
215 stars 50 forks source link

Clang style output #63

Closed f4z3r closed 5 years ago

f4z3r commented 5 years ago

Added a --pretty flag to provide "clang style" output to the user.

ghost commented 5 years ago

DeepCode analyzed this pull request. There is 1 new info report.

Click to see more details.

ghost commented 5 years ago

DeepCode analyzed this pull request. There are 2 new info reports.

Click to see more details.

f4z3r commented 5 years ago

Thanks for the comments, I will change this by tonight. Also Petar proposed to present progress information from Securify to the user (such as the decompilation stage, which contract is being analysed, etc). Should I add that in this PR or create a separate one?

hiqua commented 5 years ago

Separate one is always easier, if it's no overhead for you. Note that you can always branch off from this branch if you need stuff implemented here, and rebase on master later.

f4z3r commented 5 years ago

Ok sure will do!

f4z3r commented 5 years ago

Ok I implemented the changes. I left the OutputGenerator.java file in the project root for now, because I realised that much of the code both in Main.java and OutputGenerator.java relies on being in the same package as SolidityResult.java and CompilationHelpers.java, which might require more major changes if all but Main.java were moved to utils. Maybe some getter functions etc to not expose all fields of the results to all packages etc.

I you want me to change this, please let me know in more detail what approach you want me to choose.

Also, I now made the --pretty flag independent of the -o flag. So it will take effect as long as the input is given in the form of a compilation output (-co, as in the docker) or as a solidity file (-fs), and it is provided (so not default).

The reason I did not make the -o flag overwrite the --pretty flag is because the docker currently relies on receiving both the pretty output, and the JSON output file to determine if there are violations etc. (in order to determine the return code for Travis).

ghost commented 5 years ago

DeepCode analyzed this pull request. There is 1 new info report.

Click to see more details.