canonical / craft-cli

https://canonical-craft-cli.readthedocs-hosted.com/en/latest/
GNU Lesser General Public License v3.0
9 stars 15 forks source link

format: allow use "R|" for raw text #164

Closed syu-w closed 1 year ago

syu-w commented 1 year ago

Help text starts with "R|" will not be reformatted.

codecov[bot] commented 1 year ago

Codecov Report

Merging #164 (4149231) into main (5f880f4) will decrease coverage by 1.81%. The diff coverage is 81.81%.

@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
- Coverage   94.40%   92.59%   -1.81%     
==========================================
  Files           7        7              
  Lines        1018     1027       +9     
  Branches      187      190       +3     
==========================================
- Hits          961      951      -10     
- Misses         53       67      +14     
- Partials        4        9       +5     
Impacted Files Coverage Δ
craft_cli/helptexts.py 95.75% <81.81%> (-1.06%) :arrow_down:

... and 2 files with indirect coverage changes

tigarmo commented 1 year ago

@syu-w can you give an example of a charmcraft command line call that you want to make, and how it looks with and without this change? This might inform what we test

syu-w commented 1 year ago

This is the long lines: https://github.com/canonical/charmcraft/pull/1149/files#diff-d39be6c0a6ba463f975f6d8f301c531831ca748e6dc34071278786a6ba26b150R123-R141

I found even after this change it sill not work as expected.

syu-w commented 1 year ago

Since craft-cli use it's own way to format text, I changed the way it handles this by recognize "R|" and prevent formatting the corresponding string