twisted / pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
https://pydoctor.readthedocs.io
Other
179 stars 48 forks source link

Better understanding of operator precedence in colorizer #713

Closed tristanlatr closed 1 year ago

tristanlatr commented 1 year ago

Use parenthesis in colorized AST only if required. The only exceptions are in the presentation of the power operator and (of course) unsupported nodes, which uses astor to generate the code string. And astor gives surrounding parenthesis quite often.

Fixes #711

As a drive-by change, I've also fixed the colorization of dict unpack, which wasn't supported.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02 :warning:

Comparison is base (301d239) 92.60% compared to head (df0268a) 92.59%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #713 +/- ## ========================================== - Coverage 92.60% 92.59% -0.02% ========================================== Files 47 47 Lines 8129 8138 +9 Branches 1942 1945 +3 ========================================== + Hits 7528 7535 +7 - Misses 345 346 +1 - Partials 256 257 +1 ``` | [Impacted Files](https://app.codecov.io/gh/twisted/pydoctor/pull/713?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=twisted) | Coverage Δ | | |---|---|---| | [pydoctor/epydoc/markup/\_pyval\_repr.py](https://app.codecov.io/gh/twisted/pydoctor/pull/713?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=twisted#diff-cHlkb2N0b3IvZXB5ZG9jL21hcmt1cC9fcHl2YWxfcmVwci5weQ==) | `92.76% <100.00%> (-0.22%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

tristanlatr commented 1 year ago

I’ll merge this PR next week if there is still no review.