Add new functionality to File.comment() and improve logic flow.

Review Request #11549 — Created March 23, 2021 and submitted

chipx86
ReviewBot
release-3.0.x
reviewbot

A couple of tools tack on column information and error codes in their
own way, without there being any consistency between the approaches.
Most completely throw out this information.

This attempts to add some consistency by adding error_code and
start_column parameters to File.comment(). This will modify the
text, appending column and error code information.

While in there, I've fixed up the flow of logic to avoid setting or
computing state that won't be used (for instance, line information when
we know we won't be commenting on any lines).

Unit tests were added for all file commenting conditions.

Unit tests pass on Python 2.7 and 3.x.

Summary
Add new functionality to File.comment() and improve logic flow.
Description From Last Updated

E303 too many blank lines (2)

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (949c9de)
Loading...