| Summary: | Colourization wrong if no file specified. | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] Linux Tools | Reporter: | Kyu Lee <klee> | ||||||||||
| Component: | ChangeLog | Assignee: | Jeff Johnston <jjohnstn> | ||||||||||
| Status: | CLOSED INVALID | QA Contact: | Project Inbox <linux.changelog-inbox> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | jjohnstn, overholt, pmuldoon | ||||||||||
| Version: | unspecified | Keywords: | helpwanted | ||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Kyu Lee
Created attachment 62110 [details]
screen shot
Tentatively setting 1.0 target. Unsetting milestone. Perhaps target in 0.2. Please assign to yourself if you pick this up. Created attachment 154946 [details]
Use SingleLineRule to sort out file names
Proposed patch. Used SingleLineRule with delimiters of "\t*" and ":" instead of GnuFileEntryRule. Nothing appears to break in some testing, and should cause no colour oddities for most people.
The patch looks fine to me. (In reply to comment #4) > Created an attachment (id=154946) [details] > Use SingleLineRule to sort out file names > > Proposed patch. Used SingleLineRule with delimiters of "\t*" and ":" instead of > GnuFileEntryRule. Nothing appears to break in some testing, and should cause no > colour oddities for most people. Unfortunately, this breaks another feature. The GnuFileEntryRule supports multiple files specified over multiple lines using comma separators. It would be better to modify the rule to fix this problem. Created attachment 155997 [details]
Patch for colourization
Modify the GNU file entry rule to return fileToken only if:
1) the line is a valid file entry/is part of a valid multi-line file entry
2) the line terminates with a ',' or ':'
I will attach a screenshot to demonstrate the test cases I've run.
Created attachment 155998 [details]
Test cases for the proposed colourization patch
Test cases for the modified GNUFileEntryRule
(In reply to comment #7) > Created an attachment (id=155997) [details] > Patch for colourization > > Modify the GNU file entry rule to return fileToken only if: > 1) the line is a valid file entry/is part of a valid multi-line file entry > 2) the line terminates with a ',' or ':' > > I will attach a screenshot to demonstrate the test cases I've run. This fix has problems. An entry sometimes has a function or method specifier which occurs after the file name and starts with an open parentheses, then some characters, a closed parentheses, then the colon. For example, * a.c (myfunc): Fix typo Your change sees the whitespace after the file name and doesn't match a.c as a file name. The given entry is in error with respect to GNU Changelog format. According to the GNU Coding Standards: "An entry should have an asterisk, the name of the changed file, and then in parentheses the name of the changed functions, variables or whatever, followed by a colon. Then describe the changes you made to that function or variable." We extend that by allowing multiple files to be specified with comma separators and allowing this across multiple lines. A straight comment like the one in the bug example should not start with an asterisk. It should just be a line. For example, 2009-12-12 Jeff Johnston <jjohnstn@redhat.com> Rewriting to use IEEE parsing. * parser.c: Removed. * ieeeparser.c: New file. To get the error example to act as expected, you need to verify that either a colon or comma is next (what you already have) OR you have to create an intermediate state whereby you keep reading to verify there is white-space followed by the open parenthesis (e.g. like how the "started" variable is used). If this proves too difficult, it would not be unreasonable to say that the formatter will treat characters after the asterisk as a file name and close this bug as INVALID. Closing as invalid. |