Add .editorconfig to make indents align correctly. Also add .gitattributes#299
Open
cizra wants to merge 2 commits intotats:masterfrom
Open
Add .editorconfig to make indents align correctly. Also add .gitattributes#299cizra wants to merge 2 commits intotats:masterfrom
cizra wants to merge 2 commits intotats:masterfrom
Conversation
Contributor
|
On Thu, May 16, 2024 at 04:10:21AM -0700, Elmo Todurov wrote:
* Add .editorconfig and .gitattributes, following the existing style
AFAIU this editorconfig does not insert tabs for every second level of
indentation. While the current style might be a bad style, I think it's
better to be consistent than to mix two styles.
I'm against merging this.
|
|
Would you be kind enough to point to a resource that outlines the code style used for this repository? Thank you. |
Contributor
|
On Sun, May 26, 2024 at 05:50:44AM -0700, ndsizeif wrote:
Would you be kind enough to point to a resource that outlines the code
style used for this repository? Thank you.
I don't know of any resource.
You indent with 4 spaces, but every second level of indentation uses a
tab. So if the number of spaces you use for indentation is a multiple of
8, use a tab.
A vim modeline for this style should look like this:
/* vi: set sw=4 ts=8 ai noet : */
You find a comment in table.c which looks like this:
/* Local Variables: */
/* c-basic-offset: 4 */
/* tab-width: 8 */
/* End: */
I think this is for the original 'lint' tool - from which the words
'linter' and 'linting' come from.
And while this is not my preferred style, with a correctly configured
modern editor like vim, it's quite painless to stick to it.
When working with ed it's quite tedious though. ;)
Also, as usual with such old code bases, you will find some place, that
use a different style.
If you configure your editor to show tabstops, which you should anyways,
it's pretty obvious.
For all other things, look around the place you are editing, and do as
you see.
In general w3m uses some pretty standard C style formatting.
Hope this helps.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.