Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.editorconfig & .clang-format #24

Merged
merged 3 commits into from Apr 5, 2016
Merged

.editorconfig & .clang-format #24

merged 3 commits into from Apr 5, 2016

Conversation

@samdoshi
Copy link
Collaborator

@samdoshi samdoshi commented Apr 5, 2016

I've added a .editorconfig(website) and a .clang-format (website) to the src directory.

I've re-formatted config.mk by hand.

I've added a new make target format (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 .editorconfig or .clang-format, let me know and I can rerun.

30583, 30857,
31130, 31403, 31676, 31949, 32222, 32495, 32768, 33041, 33314, 33587,
33860, 34133,
34406, 34679
};

This comment has been minimized.

@pq

pq Apr 5, 2016
Contributor

This looks odd to me. Maybe a matter of setting ReflowComments to false?

This comment has been minimized.

@samdoshi

samdoshi Apr 5, 2016
Author Collaborator

It's possible that this just comment block just needs deleting. @tehn?

This comment has been minimized.

@tehn

tehn Apr 5, 2016
Member

yes let's throw it away

src/table.c Outdated
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
};

This comment has been minimized.

@pq

pq Apr 5, 2016
Contributor

Can clang insert a newline at EOF or is that an editor config thing?

This comment has been minimized.

@pq

pq Apr 5, 2016
Contributor

Ah, wait, I see it in .editorconfig. Maybe this file just needs to be reprocessed.

This comment has been minimized.

@samdoshi

samdoshi Apr 5, 2016
Author Collaborator

.editorconfig only applies on editor save. Not when clang-format runs. I'll edit it and force push.

@samdoshi samdoshi force-pushed the samdoshi:dev branch from 6446b83 to 201bf40 Apr 5, 2016
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

This comment has been minimized.

@pq

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

This comment has been minimized.

@samdoshi

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...

This comment has been minimized.

@pq

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?

This comment has been minimized.

@samdoshi

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.

This comment has been minimized.

@pq

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!

@tehn tehn merged commit 93ef1f5 into monome:master Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants