prowler icon indicating copy to clipboard operation
prowler copied to clipboard

feat(color): add `--no-color` flag

Open MrSecure opened this issue 1 year ago • 4 comments

Context

Fix #5294

Description

  • Import colorama's init
  • Add --no-color / -Q command line option (default False)
  • Use no_color option to control colorama init.

Checklist

  • Are there new checks included in this PR? No
  • [ ] Review if the code is being covered by tests.
    • Tests added to the parser testing library
  • [ ] Review if code is being documented following this specification https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings
  • [ ] Review if backport is needed.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

MrSecure avatar Oct 10 '24 18:10 MrSecure

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.72%. Comparing base (4181ca5) to head (8f9cb6c). Report is 1267 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5368      +/-   ##
==========================================
+ Coverage   89.38%   89.72%   +0.33%     
==========================================
  Files        1018     1086      +68     
  Lines       31278    33556    +2278     
==========================================
+ Hits        27959    30108    +2149     
- Misses       3319     3448     +129     
Components Coverage Δ
prowler 89.72% <25.00%> (+0.33%) :arrow_up:
api ∅ <ø> (∅)

codecov[bot] avatar Oct 10 '24 18:10 codecov[bot]

Hi @MrSecure, thanks a lot for your contribution! We will review this asap.

MrCloudSec avatar Oct 10 '24 19:10 MrCloudSec

Should the --only-logs flag set --no-color in addition to --no-banner ? Or does that complicate things since --only-logs is slated for removal in v5?

MrSecure avatar Oct 10 '24 19:10 MrSecure

Should the --only-logs flag set --no-color in addition to --no-banner ? Or does that complicate things since --only-logs is slated for removal in v5?

The --only-logs flag removes all the pure CLI output so there is no need to set also --no-color and it is going to be deprecated in v5 since it is no longer needed because Prowler is usable as an SDK.

Regarding the --no-banner, I think they should work independently.

jfagoagas avatar Oct 11 '24 06:10 jfagoagas

Hello @MrSecure @pedrooot I've just removed the -Q option since for now we only want to add long flags to the CLI.

Thank you!

jfagoagas avatar Oct 28 '24 10:10 jfagoagas

Thank you @MrSecure :D

toniblyx avatar Oct 28 '24 13:10 toniblyx