.editorconfig & .clang-format #24
Conversation
| 30583, 30857, | ||
| 31130, 31403, 31676, 31949, 32222, 32495, 32768, 33041, 33314, 33587, | ||
| 33860, 34133, | ||
| 34406, 34679 | ||
| }; |
pq
Apr 5, 2016
Contributor
This looks odd to me. Maybe a matter of setting ReflowComments to false?
This looks odd to me. Maybe a matter of setting ReflowComments to false?
tehn
Apr 5, 2016
Member
yes let's throw it away
yes let's throw it away
| 8936, 9100, 9266, 9434, 9604, 9777, 9952, 10129, 10309, 10491, 10675, | ||
| 10862, 11051, 11243, 11437, 11634, 11833, 12035, 12240, 12447, 12656, 12869, | ||
| 13083, 13301, 13521, 13744, 13970, 14199, 14430, 14664, 14901, 15141, 15384, | ||
| 15629, 15878, 16129 | ||
| }; |
pq
Apr 5, 2016
Contributor
Can clang insert a newline at EOF or is that an editor config thing?
Can clang insert a newline at EOF or is that an editor config thing?
pq
Apr 5, 2016
Contributor
Ah, wait, I see it in .editorconfig. Maybe this file just needs to be reprocessed.
Ah, wait, I see it in .editorconfig. Maybe this file just needs to be reprocessed.
samdoshi
Apr 5, 2016
Author
Collaborator
.editorconfig only applies on editor save. Not when clang-format runs. I'll edit it and force push.
.editorconfig only applies on editor save. Not when clang-format runs. I'll edit it and force push.
| clang-format -style=file -i teletype.h | ||
| clang-format -style=file -i teletype.c | ||
| clang-format -style=file -i euclidean/euclidean.h | ||
| clang-format -style=file -i euclidean/euclidean.c |
pq
Apr 5, 2016
Contributor
What about something like
clang-format -style=file -i *.c *.h
clang-format -style=file -i euclidean/*.c euclidean/*.h
Annoying that **/*.c doesn't work.
EDIT: better still?:
find . -name '*.c' -o -name '*.h' | xargs clang-format -style=file -i
What about something like
clang-format -style=file -i *.c *.h
clang-format -style=file -i euclidean/*.c euclidean/*.h
Annoying that **/*.c doesn't work.
EDIT: better still?:
find . -name '*.c' -o -name '*.h' | xargs clang-format -style=file -i
samdoshi
Apr 5, 2016
Author
Collaborator
Problem is we don't necessarily want to format all the files. e.g. euclidean/data.* is auto generated by euclidean.hs. Not that it really matters that much...
Problem is we don't necessarily want to format all the files. e.g. euclidean/data.* is auto generated by euclidean.hs. Not that it really matters that much...
pq
Apr 5, 2016
Contributor
Aha!
Well, you're right that it probably doesn't matter... But if it does maybe add a no format comment to the header of the file?
Aha!
Well, you're right that it probably doesn't matter... But if it does maybe add a no format comment to the header of the file?
samdoshi
Apr 5, 2016
Author
Collaborator
It's a good idea. At some point (hopefully in the not too distant future) I'd like to split the code up into smaller files, so some sort of globing will be necessary. I'll probably modify the Haskell code to generate the files as you suggest.
It's a good idea. At some point (hopefully in the not too distant future) I'd like to split the code up into smaller files, so some sort of globing will be necessary. I'll probably modify the Haskell code to generate the files as you suggest.
pq
Apr 5, 2016
Contributor
Hadn't noticed that you're generating from Haskell. Neat!
Another consideration would be to add codegen to the build process and then not commit the generated C sources. Of course, that requires all devs have haskell installed... (Maybe that's a show-stopper.)
But anyway, cool!
Hadn't noticed that you're generating from Haskell. Neat!
Another consideration would be to add codegen to the build process and then not commit the generated C sources. Of course, that requires all devs have haskell installed... (Maybe that's a show-stopper.)
But anyway, cool!
I've added a
.editorconfig(website) and a.clang-format(website) to thesrcdirectory.I've re-formatted
config.mkby hand.I've added a new
maketargetformat(it's not the best bit of Makefile magic you'll ever see...), and run it to reformat the teletype source code.If you don't particularly like any of the choices I've made it
.editorconfigor.clang-format, let me know and I can rerun.