[tor-bugs] #31759 [Core Tor/Tor]: Make "annotate_ifdef_directives" script comply with line-width limits

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Sep 25 00:26:42 UTC 2019


#31759: Make "annotate_ifdef_directives" script comply with line-width limits
--------------------------+------------------------------------
 Reporter:  nickm         |          Owner:  nickm
     Type:  defect        |         Status:  needs_review
 Priority:  Medium        |      Milestone:  Tor: 0.4.2.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  042-should    |  Actual Points:  .1
Parent ID:  #31713        |         Points:
 Reviewer:  catalyst      |        Sponsor:  Sponsor31-can
--------------------------+------------------------------------

Comment (by nickm):

 > I did make a comment on the pull request about how our stated (and
 enforced) limit seems to be 79 characters. Which one is correct? (I would
 say that 79 characters is better than 80, because of diff line prefixes,
 etc.)

 This is actually a subtle issue in the annotate_ifdef_directives code: our
 lines are 79 characters long, not counting the terminating newline.  The
 `commented_line()` function assumes that it gets a terminating newline in
 its input, and so uses 80 as the max line width.

 But yeah, I agree this is not clear.

 I could do any of these solutions:
    * Document that commented_line() requires a `fmt` that ends with a
 newline, and that LINE_WIDTH includes the newline.
    * Change the calls to commented_line() so that they do not have a
 newline in `fmt`, and change LINE_WIDTH to 79.
    * ... something else?

 Is there one that you think is best?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/31759#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list