-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Create .editorconfig #62736 #62900
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
Create .editorconfig #62736 #62900
Conversation
- Add type check for numeric_only parameter in _cython_agg_general - Raise ValueError if numeric_only is not a boolean - Add test case for validation - Closes pandas-dev#62778
…mment on line 1759 and reverted the comment change on line 1757
… from test_reductions.py
Define formatting rules for .py, .pyx, .c, meson.build, YAML, JSON, .sh, and .rst files to complement existing formatters and improve developer experience. Closes pandas-dev#62736
| charset = UTF-8 | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This instruction is a little bit invasive to be applied for all files
| [*.py] | ||
| max_line_length = 88 | ||
| indent_style = space | ||
| indent_size = 4 | ||
|
|
||
| [*.pyx] | ||
| max_line_length = 88 | ||
| indent_style = space | ||
| indent_size = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge these 2 instructions
|
|
||
|
|
||
| [*.c] | ||
| max_line_length = 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best to don't add max_line_length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, should I follow this only for this .c or every other file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no intent in adding this file to the repository.
But FYI, it depends mainly on linting settings. For Python and Pyrex this setting is enforced, so it would be beneficial. I don't recall how it's defined for C, but a textwidth of 80 seems small.
| indent_size = 2 | ||
|
|
||
| [meson.build] | ||
| max_line_length = 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
|
|
||
| [*.{yml,yaml}] | ||
| indent_style = space | ||
| indent_size = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files in the codebase has an indent size of 2, others has of 4. Keep it in 2 for now.
| indent_size = 4 | ||
|
|
||
|
|
||
| [*.c] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include .h
|
Given the discussion in #62736, we'll not be moving forward with this file so closing |
Description
This PR adds an
.editorconfigfile to improve developer experience by helping text editors and IDEs automatically apply formatting settings that align with pandas' project rules.This complements existing formatters (
ruff format,clang-format,meson-fmt) by providing immediate visual feedback in editors before files are saved/committed.Closes #62736
Checkbox Updates:
.editorconfig#62736.editorconfigsyntax and settingsChanges Made
Added
.editorconfigfile with format settings for:.py):max_line_length = 88,indent_size = 4.pyx):max_line_length = 88,indent_size = 4.c,.h):max_line_length = 80,indent_size = 2.yml,.yaml):indent_size = 4.json):indent_size = 4.sh):indent_size = 4.rst):indent_size = 4meson.build):max_line_length = 80,indent_size = 4Alignment with Project Standards
All settings align with pandas' existing conventions:
max_line_length = 88matches[tool.ruff] line-lengthinpyproject.tomlindent_size = 4matches existing code stylemax_line_length = 80,indent_size = 2) match C codebase conventionsTesting
Validated the
.editorconfigusing theeditorconfigcommand-line tool: