Coala: The file placeholder of --format option gives repetitive results

Created on 20 Dec 2016  路  6Comments  路  Source: coala/coala

When run coala with --format "file_name: {file}", it gives repetitive results if more than one line of that file is affected.

Steps to Reproduce

  1. Create a file named something.py and write some code with more than one line having trailing white spaces.
  2. now run coala -I --bears SpaceConsistencyBear --files something.py -S use_spaces=True --format "file_affected: {file}"

Actual Results

With two lines affected the result is::

file_affected: home/abhisek/Github/coala/something.py
file_affected: home/abhisek/Github/coala/something.py

Expected Results

file_affected: home/abhisek/Github/coala/something.py
difficultlow statuwontfinot happening typbug

Most helpful comment

Reopen if you disagree. This behaviour is certainly intended from my POV.

All 6 comments

I would like to work on this :)

This kind of repetitive results will occur everytime when any placeholder like line, end_line, column, end_column, id, origin is not used. So what I think is to check if all of these placeholder are missing then limit the result to only 1, else show all. Is this way good enough, or is there any better way too?
PS - Although I have still got to figure out how to do this too :wink:

hmm... when reading over this issue again I'm not sure we wanna do this.

@Flap-Py I think your suggested behaviour would be best, though you need to hack code for that into our CLI which would increase complexity while loosing the ability to see how many results were yielded. Imo it's up to the tool/user to generalize those results if wanted^^

@sils what do you think, as this affects our CLI ?

Yeah I too think that we cannot call it a bug as user is limiting the information himself here. But if we need to do anything then I would definitely try to go deeper in the code.

this looks like intended behaviour to me, notabug IMO

Reopen if you disagree. This behaviour is certainly intended from my POV.

Was this page helpful?
0 / 5 - 0 ratings