Feature description
Support the insert_final_newline for the .editorconfig files:
- lint: Check that the files end with newline characters if the property is set to true
- fix: Add a newline character if the property is set to true.
When Reading and writing the files the charset and EndOfLine properties have to be respected. Especially, writing with the wrong settings maybe break the rules of the other properties in the files. See also #3 and #4. If these properties are not set, a suitable default has to be used (same as in #5).
The specification does not require a new line character in an empty files. If white spaces in the final line are allowed (if trim_trailing_whitespace = false or not set) or an additional line break after a final line with white spaces is required, seems to be unspecified. Maybe testing in some editors can show the general approach for these situations in practice.
Benefits
To ensure new newlines at the end in all files, if the insert_final_newline property is set to true via .editorconfig.
Resources
- ec4rs - Crate to access the EditorConfig properties of files
- Documentation of the property
### Feature description
Support the `insert_final_newline` for the `.editorconfig` files:
- lint: Check that the files end with newline characters if the property is set to true
- fix: Add a newline character if the property is set to true.
When Reading and writing the files the `charset` and `EndOfLine` properties have to be respected. Especially, writing with the wrong settings maybe break the rules of the other properties in the files. See also #3 and #4. If these properties are not set, a suitable default has to be used (same as in #5).
The specification does not require a new line character in an empty files. If white spaces in the final line are allowed (if `trim_trailing_whitespace = false` or not set) or an additional line break after a final line with white spaces is required, seems to be unspecified. Maybe testing in some editors can show the general approach for these situations in practice.
### Benefits
To ensure new newlines at the end in all files, if the `insert_final_newline` property is set to true via `.editorconfig`.
### Resources
- [ec4rs](https://crates.io/crates/ec4rs) - Crate to access the EditorConfig properties of files
- Documentation of the property
- [in the crate](https://docs.rs/ec4rs/latest/ec4rs/property/enum.FinalNewline.html)
- [in the specification](https://spec.editorconfig.org/#supported-pairs)