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

Remove .editorconfig #3064

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Remove .editorconfig #3064

merged 1 commit into from
Oct 31, 2024

Conversation

DrJosh9000
Copy link
Contributor

@DrJosh9000 DrJosh9000 commented Oct 31, 2024

Description

I think that Go code should not use 2 space tabs, especially if it's just to be consistent with Ruby backend code. Personally I am used to 4 or 8 space tabs. But I also think that .editorconfig is a matter of personal preference: if you want to use 2 space tabs you go ahead and configure your editor that way. We shouldn't be supplying an .editorconfig for you.

Context

The editor I've been using started respecting this file ahead of my other config, so I'm inclined to remove the file.

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)

Copy link
Member

@pda pda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

Presumably we're using actual 0x09 tab characters, making this is purely a display option, which doesn't really help drive consistency. Arguably it might help align ASCII diagrams etc maybe? 🤷🏼‍♂️

And there's no other config in this file… 🚮

indent_size: a whole number defining the number of columns used for each indentation level and the width of soft tabs (when supported). When set to tab, the value of tab_width (if specified) will be used.

— https://editorconfig.org/#supported-properties

The documentation at https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#indent_size is super confusing:

If indent_size equals to tab, the indent_size will be set to the tab size, which should be tab_width if tab_width is specified, or the tab size set by editor if tab_width is not specified.

@DrJosh9000
Copy link
Contributor Author

Presumably we're using actual 0x09 tab characters, making this is purely a display option, which doesn't really help drive consistency. Arguably it might help align ASCII diagrams etc maybe? 🤷🏼‍♂️

Indeed, thanks to gofmt. I feel that using "hard" tabs within ASCII art is asking for trouble. gofmt will also sometimes mess with comments (usually with positive results).

@DrJosh9000 DrJosh9000 merged commit c34492f into main Oct 31, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the remove-editorconfig branch October 31, 2024 06:19
@wolfeidau
Copy link
Contributor

@DrJosh9000 @pda this is interesting, I normally add an editor configuration to repos to help contributors with preferences for non Go code, YAML, JSON and markdown.

TBH I have never seen it just target Go.

This is what I would consider normal https://github.com/editorconfig/editorconfig-core-go/blob/master/.editorconfig mostly to assist contributors in not spending ages aligning their code with the repos standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants