1
1
Fork
You've already forked ecformat
0

feature/7-indentation #42

Manually merged
BaumiCoder merged 18 commits from feature/7-indentation into main 2026年05月28日 08:17:13 +02:00

Resolves #7

User perspective

Include the indentation properties into the check and fix command. These are indent_style, indent_size and tab_width.

Developer perspective

While testing the new feature on the ecformat project itself, I found some small violations against the EditorConfig properties. See the commits 29b1b6b376, bb1c84cc0a and 6acd1667b4 for details.

Resolves #7 ### User perspective Include the indentation properties into the `check` and `fix` command. These are `indent_style`, `indent_size` and `tab_width`. ### Developer perspective While testing the new feature on the ecformat project itself, I found some small violations against the EditorConfig properties. See the commits 29b1b6b3760a1524307055a41f530b69686a0460, bb1c84cc0afe00b62f1e6ade5b8558e3a2bb0240 and 6acd1667b4e1cb59ce2b35f2b906b455b119678b for details.
The file is mostly changed with cargo itself. Therefore, manual edits
have to follow this formatting.
To avoid any changes there due to automatic modifications
The previous indentation with a hard rule of 4 spaces was wrong
(see comment in the .editorconfig file for details).
Therefore, adjust EditorConfig to this special need,
use the list marker length for indentations in list
and no indent in metadata headers following the example
from this documenation:
https://forgejo.org/docs/next/user/issue-pull-request-templates/#syntax-for-markdown-template 
Tests for the two high level funtions of IndentationHandler,
which process multiple lines. These tests consider the more common
cases and the tests for the line-based functions will cover the very
special edge cases.
Make also the fix testable on the level of a single line.
Unit Tests for the line level functions of the IndentationHandler
to cover some edge cases. No test for get_indentation() as the test
implementation would be quiet the same as the function is self
for such a simple function.
To reduce duplicated code between the two line based functions.
Document indentation support
All checks were successful
/ changes (pull_request) Successful in 1m55s
/ lint_reuse (pull_request) Successful in 1m51s
/ lint_codespell (pull_request) Successful in 1m7s
/ lint_ecformat (pull_request) Successful in 11m0s
/ test (pull_request) Successful in 4m27s
/ lint_cargo_deny (advisories) (pull_request) Has been skipped
/ lint_cargo_deny (bans licenses sources) (pull_request) Has been skipped
/ lint_clippy (pull_request) Successful in 3m28s
/ lint_rustfmt (pull_request) Successful in 1m55s
/ lint_taplo (pull_request) Has been skipped
/ lint_yamllint (pull_request) Has been skipped
/ lint_cargo_udeps (pull_request) Successful in 22m38s
/ lint_docs_rs (pull_request) Successful in 5m1s
a077562d83
Not any whitespace character is allowed in indentations,
see is_no_indentation_char() for details.
Fix messages for buggy test file names
All checks were successful
/ changes (pull_request) Successful in 53s
/ lint_reuse (pull_request) Successful in 1m12s
/ lint_codespell (pull_request) Successful in 1m7s
/ lint_ecformat (pull_request) Successful in 2m15s
/ test (pull_request) Successful in 4m30s
/ lint_cargo_deny (advisories) (pull_request) Has been skipped
/ lint_cargo_deny (bans licenses sources) (pull_request) Has been skipped
/ lint_clippy (pull_request) Successful in 3m39s
/ lint_rustfmt (pull_request) Successful in 1m44s
/ lint_taplo (pull_request) Has been skipped
/ lint_yamllint (pull_request) Has been skipped
/ lint_cargo_udeps (pull_request) Successful in 3m59s
/ lint_docs_rs (pull_request) Successful in 3m44s
d4b18e8d8c
The first file name part is skipped. Therefore, it starts with the
second part for the indent_style. Furthermore, the file name should be
part of error messages, if the parsing fails, to help with finding
the buggy file name.
BaumiCoder manually merged commit 6fb74845cd into main 2026年05月28日 08:17:13 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
EditorConfig
0.17.2
Issues to support version 0.17.2 of the EditorConfig specification
Kind
Bug
Something is not working
Kind
Chore
Some tasks maintainig tasks
Kind
Documentation
Documentation changes
Kind
Enhancement
Improve existing functionality
Kind
Feature
New functionality
Kind
Testing
Issue or pull request related to testing
Packaging
About packaging the project for some platform
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
WIP
Work in progress (Assignee is working on this issue)
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BaumiCoder/ecformat!42
Reference in a new issue
BaumiCoder/ecformat
No description provided.
Delete branch "feature/7-indentation"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?