Skip to content

Conversation

nishant361
Copy link

@nishant361 nishant361 commented Jun 15, 2025

What this PR does

This PR relaxes the insert_final_newline rule in .editorconfig by unsetting it. This helps avoid unnecessary diffs when using editors that automatically insert a final newline, especially in files that previously did not end with one.

Why it's needed

Currently, .editorconfig enforces insert_final_newline = true, but many Lua and other project files don’t follow this rule. Editors that respect .editorconfig add a newline automatically, creating unwanted diffs.

Relaxing this rule and optionally enforcing it using a linter like editorconfig-checker in CI would ensure better consistency and avoid accidental formatting changes during contributions.

Additional context

Related to the discussion started by @spacewander.

Happy to make further adjustments if needed.

Summary

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix #[issue number]

@CLAassistant
Copy link

CLAassistant commented Jun 15, 2025

CLA assistant check
All committers have signed the CLA.

@nishant361
Copy link
Author

Hi maintainers 👋

I’ve submitted this pull request and just signed the Contributor License Agreement (CLA).
Could you please approve the pending workflows and review the PR when you get a chance?

Thank you! 😊

@team-eng-enablement team-eng-enablement added the author/community PRs from the open-source community (not Kong Inc) label Jun 15, 2025
@StarlightIbuki
Copy link
Contributor

@chronolaw @bungle What do you think

@nishant361
Copy link
Author

@StarlightIbuki Hi again 👋

Just a quick follow-up on this PR — I submitted it two days ago and also signed the CLA.
This is my first-ever pull request, so I'm really excited and a bit nervous 😊
Would be grateful if someone could take a look when they get the chance or guide me if I’ve missed anything.

Thank you so much! 😊

@StarlightIbuki
Copy link
Contributor

@spacewander Should we merge this?

Copy link
Contributor

@spacewander spacewander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StarlightIbuki StarlightIbuki added the cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee label Jun 17, 2025
@spacewander spacewander changed the title Relax insert_final_newline rule in .editorconfig to avoid unwanted diffs style: relax insert_final_newline rule in .editorconfig to avoid unwanted diffs Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/community PRs from the open-source community (not Kong Inc) cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants