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

Is there any editorconf settings for the IDEs? #92

Open
juna962 opened this issue Dec 17, 2024 · 0 comments
Open

Is there any editorconf settings for the IDEs? #92

juna962 opened this issue Dec 17, 2024 · 0 comments

Comments

@juna962
Copy link

juna962 commented Dec 17, 2024

Yes, you can use an .editorconfig file to define and maintain consistent coding styles (e.g., indentation, line endings, and more) across different editors and IDEs. This file is supported by many popular text editors and IDEs like VSCode, PyCharm, and IntelliJ IDEA.

Here’s an example .editorconfig file you can use as a starting point:

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

# Top-level configuration
root = true

# All files
[*]
indent_style = space                # Use spaces for indentation
indent_size = 4                     # Indentation size (4 spaces)
end_of_line = lf                    # Use Unix-style line endings
charset = utf-8                     # File encoding
trim_trailing_whitespace = true     # Remove trailing whitespace
insert_final_newline = true         # Ensure a final newline at the end of files

# Python files
[*.py]
max_line_length = 120               # Maximum line length for Python files

# Markdown files
[*.md]
trim_trailing_whitespace = false    # Allow trailing whitespace (useful for Markdown formatting)

# JSON files
[*.json]
indent_size = 2                     # JSON files typically use 2 spaces

# YAML files
[*.yml]
indent_size = 2                     # YAML files typically use 2 spaces

Steps to Use the .editorconfig File:

  1. Create the File: Add a .editorconfig file at the root of your project directory.
  2. Ensure Compatibility: Most modern editors support .editorconfig natively. For older editors, you might need to install a plugin (e.g., EditorConfig plugin for Sublime Text).
  3. Share with Your Team: Commit the .editorconfig file to your repository so everyone in the team uses the same settings.

Benefits:

  • Ensures consistency across team members' environments.
  • Reduces code formatting issues in pull requests.
  • Simplifies onboarding for new team members.

Let me know if you'd like to customize this example further!

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

No branches or pull requests

1 participant