bugmake - Bugs: bug #48276, Better errors for accidental spaces

 
 

bug #48276: Better errors for accidental spaces

Submitter:  Steve Klabnik <steveklabnik>
Submitted:  Mon 20 Jun 2016 04:10:17 PM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.3 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Jun 2016 03:10:05 AM UTC, comment #3: 

+1, agree with Steve, such a suggestion would have saved me time and frustration at least once.

Saul St John <betafive>
Mon 20 Jun 2016 05:56:26 PM UTC, comment #2: 

So, I am not incredibly familiar with the codebase, but this is seemingly on a code path where an error is already going to happen; ie, this is a more specific form of error, rather than changing something that would have previously been parsed successfully into a failure. I would certainly agree that breaking such things wouldn't be good.

Steve Klabnik <steveklabnik>
Mon 20 Jun 2016 05:24:09 PM UTC, comment #1: 

I'm not that excited about this idea.  The problem is that lots of makefiles indent their variables, rules, etc.  For example inside "ifeq" statements, or even just to right-align variable assignments.  Having warnings about changing to TAB on most even-spaced indentations seems like it could be more confusing than helpful.

Paul D. Smith <psmith>
Group administrator
Mon 20 Jun 2016 04:10:17 PM UTC, original submission:  

Hey there,

Over the weekend, I was working with someone who uses spaces over tabs in all the programming that they do. Their editor wasn't properly configured to switch when using make, and so they got the classic "missing separator." error message. Today, I learned that make already has a special error for an eight-space indent, "missing separator (did you mean TAB instead of 8 spaces?)."

I know eight spaces is classic, but many languages use two or four space indents as a style. Would there be any interest in also adding messages for these cases? I have written a simple patch for this, but since I'm not a project member, cannot submit it directly.

Is there any interest in a patch for this? My current iteration is to do the simplest thing, and detect 2 and 4 directly, but I think with some work I could make it detect an arbitrary number, if that's preferred. Thoughts?

Steve Klabnik <steveklabnik>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #49688:  make.diff.txt added by None (709B - text/plain - Years later, it appears that either I never uploaded the patch, or it got lost somehow. Regardless, here it is; I'm not sure if it even applies right now, but if anyone finds it useful, I figured I'd share.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by betafive (Posted a comment)
  • -email is unavailable- added by thomaswinwood
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by steveklabnik (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-20 None Attached File- Added make.diff.txt, #49688
    2016-06-20 thomaswinwood Carbon-Copy- Added thomaswinwood

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code