Skip to content
Merged
Show file tree
Hide file tree
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
80 changes: 72 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,80 @@
# top-most .editorconfig file
root = true

# Global Settings: Apply to all file types in the project ✨
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
end_of_line = lf # Use Unix-style line endings (LF)
insert_final_newline = true # Ensure a newline character at the end of every file
trim_trailing_whitespace = true # Remove trailing whitespace on lines
charset = utf-8 # Use UTF-8 encoding for all files

# Kotlin-Specific Settings: Tailored for .kt and .kts files 📏
[*.{kt,kts}]
indent_size = 4
indent_style = space
max_line_length = 100
ktlint_standard_max_line_length = 100
indent_size = 4 # Standard Kotlin indentation is 4 spaces
indent_style = space # Use spaces for indentation

# Max Line Length: Adhering to Android Kotlin Style Guide (often 100 or 120) ✍️
max_line_length = 100 # The hard limit for line length
ktlint_standard_max_line_length = 100 # KtLint-specific rule for line length

# Trailing Commas: Highly Recommended for Clean Diffs and Reordering! 👍
# Set to 'true' to allow/encourage trailing commas in declarations and call sites.
# If you *really* want to remove them, set these to 'false'.
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true

# Import Order: Keep your imports tidy and consistent 📦
# Prioritizes Android/AndroidX, then common, then Java/Kotlin built-ins.
ij_kotlin_imports_layout=*,android.,androidx.,com.,org.,java.,kotlin.,^

# Blank Lines: For readability and consistent spacing 📖
ij_kotlin_blank_lines_around_declarations_in_class_body = 1 # One blank line around class members
ij_kotlin_blank_lines_before_package = 0 # No blank lines before package declaration
ij_kotlin_blank_lines_after_package = 1 # One blank line after package declaration
ij_kotlin_blank_lines_before_imports = 1 # One blank line before imports block
ij_kotlin_blank_lines_after_imports = 1 # One blank line after imports block

# KtLint Rules Configuration: Fine-tuning behavior for the linter ⚙️
# These directly map to KtLint's standard rules. Consult KtLint docs for full list.

# Allow wildcard imports (common in Android, e.g., 'import android.view.*')
ktlint_standard_no-wildcard-imports = disabled

# Ensure a final newline at the end of the file
ktlint_standard_final-newline = enabled

# Enforce filename matches top-level class/object/interface name
ktlint_standard_filename = enabled

# --- One-Line Preference Configuration! ⭐ ---
# This is where we tell KtLint to be less aggressive with line breaks and
# keep things on one line as much as possible, respecting 'max_line_length'.

# 1. Disable multiline-expression-wrapping:
# This is key for short lambdas, if-expressions, when-branches to stay on one line.
# Example: `val result = if (condition) "A" else "B"` instead of breaking.
# Disabling this means it will only break if 'max_line_length' is exceeded.
ktlint_standard_multiline-expression-wrapping = disabled

# 2. Disable string-template-indent (often related to multiline-expression-wrapping issues)
ktlint_standard_string-template-indent = disabled

# 3. Consider disabling argument-list-wrapping if it's too eager to break:
# Default behavior for KtLint might put each argument on a new line if it exceeds a certain length.
# Disabling it means arguments will try to stay on one line until 'max_line_length' is hit.
# ktlint_standard_argument-list-wrapping = disabled # Uncomment to try this!

# 4. Consider disabling chain-wrapping for chained calls:
# If you prefer `obj.doSomething().anotherThing()` to stay on one line until it's too long.
# ktlint_standard_chain-wrapping = disabled # Uncomment to try this!

# Exclusions: Ignore specific files or directories from linting/formatting 🚫
# Crucial for generated code, build files, or test files if their style differs.
[**/build/**/*.kt] # Exclude all Kotlin files within 'build' directories
ktlint = disabled

[**/src/test/**/*.kt] # Exclude Kotlin files in 'src/test' (if your test style is different)
ktlint = disabled

# [path/to/specific/generated/file.kt] # Example for a specific generated file
# ktlint = disabled
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
.externalNativeBuild
.cxx
local.properties
.idea
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

117 changes: 0 additions & 117 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/copyright/nphau.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetSelector.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/gradle.xml

This file was deleted.

73 changes: 0 additions & 73 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/migrations.xml

This file was deleted.

Loading