[GHC] #9723: Give Tab warning only once per file

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.9 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Currently, when compiling a tabbed file, GHC spits out a huge number of warnings: {{{ Main.hs:1:1: Warning: Tab character [..] Main.hs:89:1: Warning: Tab character Main.hs:90:1: Warning: Tab character Main.hs:91:1: Warning: Tab character Main.hs:92:1: Warning: Tab character Main.hs:99:4: Warning: Tab character Main.hs:100:4: Warning: Tab character Main.hs:101:4: Warning: Tab character }}} This is annoying and not very nice to our users. I suggest to replace it by {{{ This file contains tabs (e.g. line n column m); please use spaces instead }}} or (to be nice to tools that parse this output) {{{ Main.hs:1:1: Tab found here, and in n further locations. Please use spaces instead. }}} (This is clearly a low priority request, but also possibly some low- hanging fruit for new contributors.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: dalaing Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by dalaing): * owner: => dalaing -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: dalaing Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D760 -------------------------------------+------------------------------------- Changes (by dalaing): * status: new => patch * differential: => Phab:D760 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: dalaing Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D760 -------------------------------------+------------------------------------- Comment (by hvr): I'm a bit dubious about this change. While I understand the intent it seems to the first warning which is not emitted at all occurrences. So tooling can't highlight all offending lines at once, and would need to be made aware that this warning actually affects more lines. So maybe the compromise would be to have a flag to enable warning *all* tab-polluted lines, but have it default to warn only about the first occurence -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: dalaing Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D760 -------------------------------------+------------------------------------- Comment (by goldfire): While I generally agree with @hvr in wanting to think about tooling, I disagree in this instance. It's ''very'' easy for tooling to find tabs on its own -- much easier, I would bargain, than trying to parse GHC's warnings. And maintaining two different warnings, with their own flags, for "warn once" vs. "warn every time" seems heavy. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: dalaing Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D760 -------------------------------------+------------------------------------- Comment (by nomeata):
So tooling can't highlight all offending lines at once, and would need to be made aware that this warning actually affects more lines.
This is a good thing. If you edit a file with tabs in every line, highlighting every line is more annoying than helpful, IMHO. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: dalaing Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D760 -------------------------------------+------------------------------------- Comment (by dalaing): I was a bit torn as well. I mostly liked the idea of picking some low hanging fruit to get into GHC hacking :) I like using the go-to-previous-error and go-to-next-error features in my editor, and if a few tabs have crept in it'd be nice to just fix them up in my usual cycle. On the other hand, most of the tabs I've come across in the checkout of GHC have been in files where tabs are used consistently throughout the file (time, xhtml, ...) - in which case I'd prefer one warning after which I'd get my editor to retab the file and move on. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner: dalaing
Type: feature request | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 7.9
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D760
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema

#9723: Give Tab warning only once per file -------------------------------------+------------------------------------- Reporter: nomeata | Owner: dalaing Type: feature request | Status: closed Priority: low | Milestone: 7.12.1 Component: Compiler | Version: 7.9 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | parser/should_compile/T9723{a,b} | Blocking: | Differential Revisions: Phab:D760 -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * testcase: => parser/should_compile/T9723{a,b} * resolution: => fixed * milestone: => 7.12.1 Comment: Yeah! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9723#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9723: Give Tab warning only once per file
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner: dalaing
Type: feature request | Status: closed
Priority: low | Milestone: 7.12.1
Component: Compiler | Version: 7.9
Resolution: fixed | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | parser/should_compile/T9723{a,b}
| Blocking:
| Differential Revisions: Phab:D760
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema
participants (1)
-
GHC