r197542 - clang-format-diff.py: add the OpenCL file extension

Alp Toker alp at nuanti.com
Wed Dec 18 05:16:39 PST 2013


On 18/12/2013 06:55, Daniel Jasper wrote:
> I think we should revert this. cl is also the default extension for 
> common lisp programs and we most definitely don't format those 
> correctly (or within reasonable amount of time).

I found 60 OpenCL files and 2 lisp files in the nearest source tree I 
had to hand.

And of those two, both list files have the .el extension, not .cl.

A lisp developer* says on the topic:

> Common Lisp pathname endings for source code:
>
>   * |lisp|is the default. Use this if possible.
>   * |lsp|if the pathname type allows only three characters
>   * |l|if the pathname type should be one character (rare).
>
> The pathname type|cl|is mostly not used. You can see it sometimes in 
> older code or projects which use several different Lisp dialects.
>

The odds of someone running the clang-format-diff.py tool on such a file 
seems remote.

Meanwhile there's an immediate benefit to formatting source files we 
know about and have to maintain here on the project.

If someone insists on running a C-family formatting tool on their lisp 
files, they could simply exclude them with the -regex option we added 
recently..

On the other hand, I found more than 100 .m files on my drive that were 
MATLAB files. If this is a genuine concern I suggest we start there ;-)

Alp.

* 
http://stackoverflow.com/questions/15187240/what-is-the-convention-for-lisp-filename-extension



>
>
> On Wed, Dec 18, 2013 at 1:58 AM, Alp Toker <alp at nuanti.com 
> <mailto:alp at nuanti.com>> wrote:
>
>     Author: alp
>     Date: Tue Dec 17 18:58:58 2013
>     New Revision: 197542
>
>     URL: http://llvm.org/viewvc/llvm-project?rev=197542&view=rev
>     Log:
>     clang-format-diff.py: add the OpenCL file extension
>
>     It's handled correctly as a C-family language.
>
>     Modified:
>         cfe/trunk/tools/clang-format/clang-format-diff.py
>
>     Modified: cfe/trunk/tools/clang-format/clang-format-diff.py
>     URL:
>     http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py?rev=197542&r1=197541&r2=197542&view=diff
>     ==============================================================================
>     --- cfe/trunk/tools/clang-format/clang-format-diff.py (original)
>     +++ cfe/trunk/tools/clang-format/clang-format-diff.py Tue Dec 17
>     18:58:58 2013
>     @@ -47,7 +47,7 @@ def main():
>                            help='custom pattern selecting file paths
>     to reformat '
>                            '(case sensitive, override -iregex)')
>        parser.add_argument('-iregex', metavar='PATTERN', default=
>     -  r'.*\.(cpp|cc|c\+\+|cxx|c|h|hpp|m|mm|inc|js)',
>     +  r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc|js)',
>                            help='custom pattern selecting file paths
>     to reformat '
>                            '(case insensitive, override -regex)')
>        parser.add_argument(
>
>
>     _______________________________________________
>     cfe-commits mailing list
>     cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
>     http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>

-- 
http://www.nuanti.com
the browser experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131218/39be5d91/attachment.html>


More information about the cfe-commits mailing list