SUPERAndroidAnalyzer / super

Secure, Unified, Powerful and Extensible Rust Android Analyzer
https://superanalyzer.rocks/
GNU General Public License v3.0
421 stars 59 forks source link

Use serde to load config #120

Closed gnieto closed 7 years ago

gnieto commented 7 years ago

Use serde to load config files to make easier the config parsing. Should close: https://github.com/SUPERAndroidAnalyzer/super/issues/117

Warning when some field is not correct: captura de pantalla 2017-04-19 a las 1 00 48

codecov[bot] commented 7 years ago

Codecov Report

Merging #120 into develop will decrease coverage by 4.48%. The diff coverage is 60.56%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #120      +/-   ##
===========================================
- Coverage    58.37%   53.88%   -4.49%     
===========================================
  Files            6        6              
  Lines         2650     2353     -297     
===========================================
- Hits          1547     1268     -279     
+ Misses        1103     1085      -18
Impacted Files Coverage Δ
src/config.rs 82.37% <52.94%> (-5.03%) :arrow_down:
src/static_analysis/manifest.rs 26.19% <80%> (+0.34%) :arrow_up:
src/main.rs 95.08% <80%> (-4.92%) :arrow_down:
src/results/utils.rs 90% <0%> (-10%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dbc07e8...adbb123. Read the comment docs.

gnieto commented 7 years ago

Pushed one more commit changing the config loading. As we are using serde_derive, it's not possible to mimic the previous behaviour: Load from /etc/config.toml, then decorate the config with the config.toml on the root and finally the CLI flags.

Now, it will try to load from /etc/config.toml if ran on Unix and config.toml non existing on the current path. On other platforms, config.toml is loaded if it exsits. If non of them exists, the default values are used.

Are you ok with the new behaviour?

Razican commented 7 years ago

I like the workflow, yes, but wasn't that the behaviour before?