[ci skip] You can view, comment on, or merge this pull request online at:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/350
-- Commit Summary --
* CONTRIBUTING.md: Add some style guidelines
-- File Changes --
M CONTRIBUTING.md (39)
-- Patch Links --
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/350.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/350.diff
Hi All,
This adds two guidelines to CONTRIBUTING.md following on from the coding convention discussion that Ben started (and which is still ongoing) (thanks, Ben!):
- Separate function declaration type and name to two lines - Tabs are 4 spaces
Since this is intended to become the documentation, it is written as a fait accompli, but I of course welcome discussion.
Cheers, Alistair
On Sun, 6 Jan 2019 at 08:09, akgrant43 notifications@github.com wrote:
[ci skip]
You can view, comment on, or merge this pull request online at:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/350
Commit Summary
CONTRIBUTING.md: Add some style guidelines
File Changes
M CONTRIBUTING.md (39)
Patch Links:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/350.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/350.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
fniephaus commented on this pull request.
@@ -212,3 +212,30 @@ If you were working on a feature branch, do this:
If your feature branch is ready or you are an external contributor with your own fork, use the github web interface to open a pull request. + + +# C Source Code Formatting + +When editing an existing file, please be polite and first follow the +guidelines below, and secondly follow the general rule of keeping to the +same formatting conventions as exist in the file. + + +## C Function Declarations + +C function declarations should have the type on one line and the +function name and parameters on the following line, e.g.: + +```
Adding a *c* to the end of this line should enable C-syntax highlight.
+C function declarations should have the type on one line and the +function name and parameters on the following line, e.g.: + +``` +static int +convertCopy(char *from, int fromLen, char *to, int toLen, int term) +``` + +This facilitates searching for function definitions by searching for the +name at the beginning of the line. + + +## Tabs are 4 spaces + +The heading says it all.
I'm afraid the title doesn't answer the question *when to use* spaces/tabs? Are tabs banned?
nicolas-cellier-aka-nice commented on this pull request.
+C function declarations should have the type on one line and the +function name and parameters on the following line, e.g.: + +``` +static int +convertCopy(char *from, int fromLen, char *to, int toLen, int term) +``` + +This facilitates searching for function definitions by searching for the +name at the beginning of the line. + + +## Tabs are 4 spaces + +The heading says it all.
A side note: the legacy platforms/win32 is using these settings:
8-space tabs stops 2-space indent
I don't want to create massive change of ownership for fixing that... https://stackoverflow.com/questions/4112410/git-change-styling-whitespace-wi...
Hi Fabio & Nicolas,
Thanks for your feedback and my apologies for not responding, I've been caught up with other things the last couple of weeks. I haven't forgotten and definitely not ignoring this.
Cheers, Alistair
No worries at all, there's no rush. Have a great weekend...
Fabio
@akgrant43 pushed 1 commit.
22672293c96b45e78b9ca646833ee1817cec65bc CONTRIBUTING.md: formatting guidelines
There haven't been any more comments for a couple of weeks. I'm not particularly happy with the section on tabs vs spaces, however it's always easier to criticise someone else's work than start with a blank slate, so take this as inspiration! :-)
[ci skip]
Closed #350.
Reopened #350.
Merged #350 into Cog.
vm-dev@lists.squeakfoundation.org