Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# EditorConfig helps maintain consistent coding styles across different editors and IDEs
# Documentation: https://editorconfig.org/
# for more information scroll to the bottom of this file.

# Top-most EditorConfig file
root = true

# Universal settings for all files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

# Markdown files
[*.md]
# Trailing whitespace is significant in Markdown (two spaces = line break)
trim_trailing_whitespace = false

# YAML files
[*.{yml,yaml}]
indent_size = 2
indent_style = space

# JSON files
[*.json]
indent_size = 2
indent_style = space

# JavaScript/TypeScript
[*.{js,jsx,ts,tsx}]
indent_size = 2
indent_style = space

# Python files
[*.py]
indent_size = 4
indent_style = space

# Java files
[*.java]
indent_size = 4
indent_style = space

# C/C++ files
[*.{c,cpp,h,hpp}]
indent_size = 4
indent_style = space

# Shell scripts
[*.sh]
indent_size = 2
indent_style = space

# Makefiles (must use tabs)
[Makefile]
indent_style = tab

[*.mk]
indent_style = tab

# Configuration files
[*.{toml,ini,cfg}]
indent_size = 2
indent_style = space

# XML/HTML files
[*.{xml,html,svg}]
indent_size = 2
indent_style = space

# CSS/SCSS/LESS files
[*.{css,scss,sass,less}]
indent_size = 2
indent_style = space

# Package manager files
[{package.json,package-lock.json}]
indent_size = 2
indent_style = space

[{*.gradle,*.gradle.kts}]
indent_size = 4
indent_style = space
Comment on lines +22 to +86
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider removing redundant settings for maintainability.

Several file-type sections repeat settings already defined in the universal [*] section:

  • Entirely redundant sections (both indent_size = 2 and indent_style = space are universal defaults):

    • YAML (lines 22-25)
    • JSON (lines 27-30)
    • JavaScript/TypeScript (lines 32-35)
    • Shell scripts (lines 52-55)
    • Config files (lines 64-67)
    • XML/HTML (lines 69-72)
    • CSS/SCSS/LESS (lines 74-77)
    • Package manager files (lines 79-82)
  • Partially redundant (indent_style = space is already universal):

    • Python (line 40)
    • Java (line 45)
    • C/C++ (line 50)
    • Gradle (line 86)

Removing redundant settings would make the file more maintainable and easier to scan. Only settings that differ from universal defaults need to be specified.

♻️ Streamlined version removing redundancies
-# YAML files
-[*.{yml,yaml}]
-indent_size = 2
-indent_style = space
-
-# JSON files
-[*.json]
-indent_size = 2
-indent_style = space
-
-# JavaScript/TypeScript
-[*.{js,jsx,ts,tsx}]
-indent_size = 2
-indent_style = space
-
 # Python files
 [*.py]
 indent_size = 4
-indent_style = space
 
 # Java files
 [*.java]
 indent_size = 4
-indent_style = space
 
 # C/C++ files
 [*.{c,cpp,h,hpp}]
 indent_size = 4
-indent_style = space
-
-# Shell scripts
-[*.sh]
-indent_size = 2
-indent_style = space
 
 # Makefiles (must use tabs)
 [Makefile]
 indent_style = tab
 
 [*.mk]
 indent_style = tab
-
-# Configuration files
-[*.{toml,ini,cfg}]
-indent_size = 2
-indent_style = space
-
-# XML/HTML files
-[*.{xml,html,svg}]
-indent_size = 2
-indent_style = space
-
-# CSS/SCSS/LESS files
-[*.{css,scss,sass,less}]
-indent_size = 2
-indent_style = space
-
-# Package manager files
-[{package.json,package-lock.json}]
-indent_size = 2
-indent_style = space
 
 [{*.gradle,*.gradle.kts}]
 indent_size = 4
-indent_style = space
🤖 Prompt for AI Agents
In @.editorconfig around lines 22 - 86, The .editorconfig contains many per-file
sections that duplicate the universal [*] defaults; remove the entirely
redundant sections ([*.{yml,yaml}], [*.json], [*.{js,jsx,ts,tsx}], [*.sh],
[*.{toml,ini,cfg}] if identical, [*.{xml,html,svg}], [*.{css,scss,sass,less}],
[{package.json,package-lock.json}]) and consolidate any needed overrides into
only the sections that differ from the universal [*] settings; for partially
redundant entries (e.g., [*.py], [*.java], [*.{c,cpp,h,hpp}],
[{*.gradle,*.gradle.kts}]) remove the duplicated indent_style or indent_size
lines so each section only contains settings that override the [*] defaults.




# For full list of Supported Editors: https://editorconfig.org/#pre-installed
#
# Common Properties:
# ------------------
# - indent_style: "space" or "tab"
# - indent_size: number of columns for each indentation level
# - end_of_line: "lf", "cr", or "crlf"
# - charset: "utf-8", "utf-16be", "utf-16le", "latin1"
# - trim_trailing_whitespace: true or false
# - insert_final_newline: true or false
# - max_line_length: number (not supported by all editors)
#
# File Pattern Matching:
# ----------------------
# - * : matches any string of characters (except path separator)
# - ** : matches any string of characters
# - ? : matches any single character
# - [name] : matches any single character in name
# - [!name] : matches any single character not in name
# - {s1,s2,s3} : matches any of the strings given (comma-separated)
#
# For more information and queries:
# - Official Documentation: https://editorconfig.org/
# - Specification: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
# - Plugin Downloads: https://editorconfig.org/#download
Loading