|
| 1 | +# EditorConfig is awesome: https://EditorConfig.org |
| 2 | +# See options at: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#current-universal-properties |
| 3 | +# Intellij options starts with `ij` |
| 4 | + |
| 5 | +# top-most EditorConfig file |
| 6 | +# The editor looks up the directory tree until it finds `root = true` |
| 7 | +root = true |
| 8 | + |
| 9 | +# Match all files |
| 10 | +[*] |
| 11 | +charset = utf-8 |
| 12 | +indent_style = space |
| 13 | +indent_size = 2 |
| 14 | +trim_trailing_whitespace = true |
| 15 | +end_of_line = lf |
| 16 | +# false insert_final_newline otherwise you get it also in a markdown code fence |
| 17 | +# and this is the check that fails most often |
| 18 | +insert_final_newline = unset |
| 19 | + |
| 20 | +# https://www.jetbrains.com/help/idea/settings-code-style-xml.html |
| 21 | +[*.xml] |
| 22 | +# Why align_attributes false? |
| 23 | +# On a pom.xml, if on, the indentation is 9 on the second line: ie 8 (project length) + 1 space |
| 24 | +# It clashes with an indent_size of 2 |
| 25 | +# Example: |
| 26 | +# <project xmlns |
| 27 | +# xmlns:xsi> |
| 28 | +ij_xml_align_attributes = false |
| 29 | + |
| 30 | +# https://github.com/mvdan/sh |
| 31 | +# https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd#examples |
| 32 | +# noinspection EditorConfigKeyCorrectness |
| 33 | +[{*.bash,*.sh,*.zsh,.envrc,.envrc.jinja2}] |
| 34 | +# formats code for POSIX-compliant shells rather than bash-specific features. |
| 35 | +shell_variant = posix # like -ln=posix |
| 36 | +simplify = true |
| 37 | +# Places binary operators (&&, ||, |) at the beginning of the next line in multi-line commands, rather than at the end of the previous line. |
| 38 | +binary_next_line = unset # like -bn |
| 39 | +ij_shell_binary_ops_start_line = unset |
| 40 | +# indents case statement branches an additional level inside the case block, making the structure more visually clear. |
| 41 | +switch_case_indent = true # like -ci |
| 42 | +ij_shell_switch_cases_indented = true |
| 43 | +# adds spaces around redirection operators (e.g., > file instead of >file), improving readability. |
| 44 | +space_redirects = true # like -sr |
| 45 | +ij_shell_redirect_followed_by_space = true |
| 46 | +# Preserves alignment padding in consecutive lines, useful for keeping column-like structures aligned (such as variable assignments or array elements). |
| 47 | +keep_padding = true # like -kp |
| 48 | +# places the opening brace of function definitions on the next line rather than on the same line as the function name. |
| 49 | +function_next_line = true # like -fn |
| 50 | +# Prevents shfmt from splitting long lines. Lines will remain as-is rather than being automatically wrapped, giving you manual control over line breaks. |
| 51 | +never_split = true # like -ns |
| 52 | +# Don't delete any space |
| 53 | +minify = false |
| 54 | +ij_shell_minify_program = false |
| 55 | + |
| 56 | +[*.md] |
| 57 | +# indent is unset because |
| 58 | +# due to list alignment, it is 2 with star list and 3 with number list |
| 59 | +# ie |
| 60 | +# * First |
| 61 | +# Second |
| 62 | +# 1) First |
| 63 | +# Second |
| 64 | +indent_size = unset |
| 65 | + |
| 66 | +[*.ts] |
| 67 | +# indent is unset because |
| 68 | +# a comment has only one space margin in intellij |
| 69 | +# ie |
| 70 | +# /** |
| 71 | +# * Star is at once space |
| 72 | +indent_size = unset |
| 73 | + |
| 74 | +[*.java] |
| 75 | +# Due to catch (IllegalBlockSizeException |
| 76 | +# InvalidKeyException e) { |
| 77 | +indent_size = unset |
| 78 | +# Block comment (single star on all lines!) should align to the code and not to the first column |
| 79 | +# By default, only javadoc comment (double star) do that |
| 80 | +ij_java_block_comment_at_first_column = false |
| 81 | +# if true, the comments characters (//) are set at the beginning |
| 82 | +ij_java_line_comment_at_first_column = false |
0 commit comments