pyupio / safety

Safety checks Python dependencies for known security vulnerabilities and suggests the proper remediations for vulnerabilities detected.
https://safetycli.com/product/safety-cli
MIT License
1.66k stars 141 forks source link

Support line breaks on Advisories #316

Closed nicholasks closed 3 years ago

nicholasks commented 3 years ago

This PR will change the way we are dealing with line breaks \n, allowing us to have a single line break in the middle of an sentence.

Given a JSON advisory: { "advisory": "hello \none line \r\n\r\ntwo lines" }

Current version are rendering this way:

hello  one line

two lines

New version will render:

hello  
one line 

two lines

The max width per line (76) is still followed.

codecov[bot] commented 3 years ago

Codecov Report

Merging #316 (ad34959) into master (e09d12f) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #316   +/-   ##
=======================================
  Coverage   69.51%   69.51%           
=======================================
  Files           8        8           
  Lines         538      538           
=======================================
  Hits          374      374           
  Misses        164      164           
Impacted Files Coverage Δ
safety/formatter.py 50.87% <100.00%> (ø)

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 e09d12f...ad34959. Read the comment docs.

nicholasks commented 3 years ago

LGTM. Rebase and update HISTORY, please.

@rafaelpivato done!