1
1
Fork
You've already forked ecformat
0

Finalize support for EditorConfig specification 0.17.2 #46

Manually merged
BaumiCoder merged 7 commits from enhancement/finalize-0.17.2-editorconfig-support into main 2026年06月01日 10:57:47 +02:00

User perspective

As ecformat support now all properties of the EditorConfig specification 0.17.2, the version information of ecformat no includes this version of the EditorConfig specification. Furthermore, the supported version is also accessible when using ecformat as a lib crate. Use the ecformat::editorconfig_version macro for this.

Developer perspective

Beside the extension of the version information, I tried to make simple performance improvement by reducing the number of file reads and writes. However, this did not turn out as expected. Therefore, I made issue #45 to consider that sometime later.

Furthermore, this Pull Request adds root = true for the .editorconfig files in the Integration tests to avoid failing tests due to other .editorconfig files.

### User perspective As ecformat support now all properties of the [EditorConfig specification](https://spec.editorconfig.org/) 0.17.2, the version information of ecformat no includes this version of the EditorConfig specification. Furthermore, the supported version is also accessible when using ecformat as a lib crate. Use the `ecformat::editorconfig_version` macro for this. ### Developer perspective Beside the extension of the version information, I tried to make simple performance improvement by reducing the number of file reads and writes. However, this did not turn out as expected. Therefore, I made issue #45 to consider that sometime later. Furthermore, this Pull Request adds `root = true` for the `.editorconfig` files in the Integration tests to avoid failing tests due to other `.editorconfig` files.
Although ecformat itself is no EditorConfig core
(ec4rs is the core in use), add the version of the implementation
EditorConfig specification as requested for cores in the specification.
https://spec.editorconfig.org/#versioning 
To show how the string can be used in a more structored and typed way
and to ensure that the string always contains a valid version.
The alternative approach to use macro which returns a semver::Version
seems to be not usable to convert this to string for usage in the
version text of ecformat.
To reduce IO on the disc and speed up the process.
This reverts commit 4177b0fcdd.
Testing the performance difference on the source code of chromium and android
(some larger projects with an EditorConfig)
shows that the previous approach to read the files multiple times is faster
than reading them only ones.
Tests with &str instead of &[u8] to pass the file contents is faster,
but still slower than reading multiple times.
The &[u8] approach takes about 4 to 10 times longer than multiple reads.
The &str approach takes about 1.5 to 2 times longer than multiple reads.
Reason could be a different caching behavior.
Adjust documentation to full EditorConfig support
Some checks failed
/ changes (pull_request) Successful in 54s
/ lint_reuse (pull_request) Successful in 1m13s
/ lint_codespell (pull_request) Successful in 1m6s
/ lint_ecformat (pull_request) Successful in 9m25s
/ test (pull_request) Successful in 4m28s
/ lint_cargo_deny (advisories) (pull_request) Successful in 3m7s
/ lint_cargo_deny (bans licenses sources) (pull_request) Successful in 2m24s
/ lint_rustfmt (pull_request) Has been cancelled
/ lint_taplo (pull_request) Has been cancelled
/ lint_yamllint (pull_request) Has been cancelled
/ lint_cargo_udeps (pull_request) Has been cancelled
/ lint_docs_rs (pull_request) Has been cancelled
/ lint_clippy (pull_request) Has been cancelled
585440a33b
@ -39,3 +39,3 @@
anyhow = "1.0.102"
charset-normalizer-rs = "1.1.0"
clap = { version = "4.5.60", features = ["derive", "wrap_help"] }
clap = { version = "4.5.60", features = ["cargo", "derive", "wrap_help"] }
Author
Owner
Copy link

The feature cargo is necessary for the clap::crate_version macro.

The feature `cargo` is necessary for the `clap::crate_version` macro.
Avoid test fails due to other .editorconfig files
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 1m57s
/ test (pull_request) Successful in 4m32s
/ lint_cargo_deny (advisories) (pull_request) Successful in 2m27s
/ lint_cargo_deny (bans licenses sources) (pull_request) Successful in 2m26s
/ lint_clippy (pull_request) Successful in 3m26s
/ lint_rustfmt (pull_request) Successful in 1m56s
/ lint_taplo (pull_request) Successful in 1m56s
/ lint_yamllint (pull_request) Has been skipped
/ lint_cargo_udeps (pull_request) Successful in 22m40s
/ lint_docs_rs (pull_request) Failing after 4m1s
95a6854e90
There could be .editorconfig files in the parent directories of the
temporary test directories. Adding root = true avoid failing tests due
to this and may also speed up the test runs as less seach for relevant
.editorconfig files is necessary.
Fix link in doc comments
All checks were successful
/ changes (pull_request) Successful in 53s
/ lint_reuse (pull_request) Successful in 1m12s
/ lint_codespell (pull_request) Successful in 1m6s
/ lint_ecformat (pull_request) Successful in 2m0s
/ test (pull_request) Successful in 4m32s
/ lint_cargo_deny (advisories) (pull_request) Successful in 2m27s
/ lint_cargo_deny (bans licenses sources) (pull_request) Successful in 2m27s
/ lint_clippy (pull_request) Successful in 3m26s
/ lint_rustfmt (pull_request) Successful in 1m46s
/ lint_taplo (pull_request) Successful in 1m57s
/ lint_yamllint (pull_request) Has been skipped
/ lint_cargo_udeps (pull_request) Successful in 3m58s
/ lint_docs_rs (pull_request) Successful in 4m21s
886341fab5
Workflow for the docs.rs lint fails as the semver crate is only a
development dependency of ecformat. As ecformat only needs the crate
for the docs test below, adding it as a normal dependency only for
docs.rs is not suitable. Therefore, use a normal web link.
BaumiCoder manually merged commit f39f15a444 into main 2026年06月01日 10:57:47 +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!46
Reference in a new issue
BaumiCoder/ecformat
No description provided.
Delete branch "enhancement/finalize-0.17.2-editorconfig-support"

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?