1
1
Fork
You've already forked ecformat
0

Command to get informations about the EditorConfig usage in the targets #50

Manually merged
BaumiCoder merged 33 commits from feature/38-status-command into main 2026年06月04日 12:38:31 +02:00

Resolves #38

User perspective

This Pull Request adds the command status to ecformat. It gives information about what .editorconfig files are relevant for the given targets. Furthermore, it lists what EditorConfig properties (incl. values) apply to all the target files. For more details see the CLI help for example with ecformat help status.

(Beside this a small adjustment for #8: All relevant .editorconfig files for the target files are considered. This also include .editorconfig files in parent directories of the target directories.)

Developer perspective

In the context of changes for this issue, I also found a bug in test cases, which I addressed with 232fa4edc7 as it was also relevant for the tests for these changes. Furthermore, clippy have not failed yet on warnings in the CI and the pre-commit (on push)! Detect due to the warnings addressed with a452dc66ea. Fixed the clippy behavior in CI and pre-commit with 4d4609cc1c.

Resolves #38 ### User perspective This Pull Request adds the command `status` to ecformat. It gives information about what `.editorconfig` files are relevant for the given targets. Furthermore, it lists what EditorConfig properties (incl. values) apply to all the target files. For more details see the CLI help for example with `ecformat help status`. (Beside this a small adjustment for #8: All relevant `.editorconfig` files for the target files are considered. This also include `.editorconfig` files in parent directories of the target directories.) ### Developer perspective In the context of changes for this issue, I also found a bug in test cases, which I addressed with 232fa4edc71873c370409d0f4a530ea4541b05b0 as it was also relevant for the tests for these changes. Furthermore, clippy have not failed yet on warnings in the CI and the pre-commit (on push)! Detect due to the warnings addressed with a452dc66ea7275ac6073503c828648279ec7d365. Fixed the clippy behavior in CI and pre-commit with 4d4609cc1c876dab8e369eab0fb487e6fcac1b0b.
Depending on the way of producing Path instances, they are not always
relative paths. Therefore, use absolute paths in for all files tests
and use them also for the starts_with assertions. Otherwise,
the assertion simply cannot find the relative path in an absolute path
which can lead to miss a bug.
For a given target directory not only the .editorconfig files in it
are relevant for the files in it. The .editorconfig files from parent
directories can also be relevant.
This change effect the status command and the spelling_language check.
For both it seems more logical to me, that all .editorconfig files
of the considered files are in the scope.
Writting the status info via logging has the disadvantages,
that a higher verbosity is required to get any output and is not
suitable in case of using ecformat as lib crate.
Therefore, using a struct to return the status info, which provides
functions to get the text representation of the status for printing.
To allow usage also in other tests
Same as in SpellingLanguageHandler::build
Although, the language for the VSCodium extension LTeX+ is set already,
a general setting for the spelling language is may helpful when using
other editors to contribute to ecformat.
- Rename from get_path() to path() as the prefix is not common in Rust.
- Change the return type from &PathBuf to &Path as
 this can be used more flexible.
To reduce the vebose proceding of all properties
There is only one string property and one integer (only) property.
Therefore, the full enums in the test cases for them are not necessary
to see what property it is and the primitve type is enough.
This reduces how verbose the respective test code is.
Mention the status command in the README
Some checks failed
/ changes (pull_request) Successful in 52s
/ lint_reuse (pull_request) Successful in 1m13s
/ lint_codespell (pull_request) Successful in 1m6s
/ lint_ecformat (pull_request) Successful in 9m30s
/ test (pull_request) Successful in 4m34s
/ 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 3m27s
/ lint_rustfmt (pull_request) Successful in 1m54s
/ lint_taplo (pull_request) Has been skipped
/ lint_yamllint (pull_request) Has been skipped
/ lint_cargo_udeps (pull_request) Successful in 23m2s
/ lint_docs_rs (pull_request) Failing after 4m7s
119585b9d3
The CLI help has a section to "disable" EditorConfig properties.
Therefore, talking about enabled properties is more consistent.
Rename the status module to resolve the name clash
with the status function in the src/lib.rs.
This allows to use both in the same module, such as in src/lib.rs or
tests/status.rs.
Remove "redundant explicit link target",
"because label contains path that resolves to same destination"
(cites from the docs.rs warning).
The warnings the in status_types Unit Tests are not visible in VSCodium
(due to some error). They are listed with cargo clippy if the test
targets are included. However, the automatic runs of clippy do not
fail on warnings! Adding a CLI to make them failing as expected.
Allow too_many_arguments for parametrized tests
All checks were successful
/ changes (pull_request) Successful in 56s
/ lint_reuse (pull_request) Successful in 1m12s
/ lint_codespell (pull_request) Successful in 1m6s
/ lint_ecformat (pull_request) Successful in 2m1s
/ test (pull_request) Successful in 4m32s
/ lint_cargo_deny (advisories) (pull_request) Successful in 3m0s
/ lint_cargo_deny (bans licenses sources) (pull_request) Successful in 2m27s
/ lint_clippy (pull_request) Successful in 3m31s
/ lint_rustfmt (pull_request) Successful in 1m49s
/ lint_taplo (pull_request) Successful in 2m7s
/ lint_yamllint (pull_request) Successful in 1m7s
/ lint_cargo_udeps (pull_request) Successful in 4m3s
/ lint_docs_rs (pull_request) Successful in 4m23s
a452dc66ea
Allowing this clippy warning in all test code would be also fine.
However, the only way to do this seems to use compiler flafs for the
profile.test, but this feature is not stable in cargo yet, see issue:
https://github.com/rust-lang/cargo/issues/10271 
BaumiCoder manually merged commit a3cd8362d5 into main 2026年06月04日 12:38:31 +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!50
Reference in a new issue
BaumiCoder/ecformat
No description provided.
Delete branch "feature/38-status-command"

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?