sunpy / package-template

A cookiecutter template for packages that want to have a similar setup to sunpy
2 stars 4 forks source link

Add .editorconfig #44

Open Cadair opened 4 months ago

Cadair commented 4 months ago

Describe the feature

https://github.com/sunpy/sunpy/blob/main/.editorconfig

@wtbarnes DEBATE!

Proposed solution

No response

nabobalis commented 4 months ago

Debate what?

Cadair commented 4 months ago

The existence of the file.

nabobalis commented 4 months ago

Why?

wtbarnes commented 4 months ago

Ha I mean if people find it useful and it's relatively easy to maintain, I won't raise a stink about it. I haven't personally found it useful in any of the editors I've used but 🤷‍♂️.

If a package that used the template wanted to remove this file and not use it, would that create conflicts later on when keeping up to date with the upstream template, ie would an automatically-triggered PR try to add it back?

nabobalis commented 4 months ago

I forgot why it's useful.

wtbarnes commented 4 months ago

Yeah that's what I meant by "if people find it useful." If we don't have examples of that, I don't see a need to keep it.

nabobalis commented 4 months ago

I think I have a plugin for vs code to use it if it exists but all the projects I work on are python, so it's kind of useless

nabobalis commented 4 months ago

Python linting tools help us ensure we don't need this for Python however for other file types, since we do not lint them at at all, an editor config helps us here:

Their example has the following:


# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
``