Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make recommended/default editor settings available to commiters #8130

Open
homberghp opened this issue Jan 9, 2025 · 5 comments
Open

Make recommended/default editor settings available to commiters #8130

homberghp opened this issue Jan 9, 2025 · 5 comments
Labels
kind:feature A feature request needs:triage Requires attention from one of the committers

Comments

@homberghp
Copy link
Contributor

Description

When working on a bug fix, one might accidentally invoke reformatting either by global settings or the keyboard shortcut, which is engraved in my muscle memory.
This messes up the code.

Use case/motivation

Avoid extra work

My personal preferences may differ from the recommended (I like horizontal whitespace to improve readability),
so to avoid and extra work, I would like to use the project-specific settings.

Related issues

earlier pull request

Are you willing to submit a pull request?

Yes

@homberghp homberghp added kind:feature A feature request needs:triage Requires attention from one of the committers labels Jan 9, 2025
@neilcsmith-net
Copy link
Member

I'm not sure I understand the request here. Generally I think we prefer the standard NetBeans settings. But lots of things do not follow that. We generally don't reformat existing code unless it's being edited, as it makes changes hard to review. I assume you're aware the keyboard shortcut will limit itself to the selection?

@mbien
Copy link
Member

mbien commented Jan 10, 2025

The NB project does not have any enforced formatting. For new code we encourage formatting which is close to NB's default settings - some prefer longer lines, others wrap more often - it doesn't have to be that strict IMO.

So even if we would add project specific settings for this repo, you couldn't simply hit reformat after editing without causing unrelated changes. Reformatting the whole repo would be a big disturbance for little gain. Better investment would be deprecation warning fixes for example.

@homberghp
Copy link
Contributor Author

homberghp commented Jan 14, 2025

Thank you for the answer, but I still have the following problems.

  • I do not know how to get to the default NetBeans formatting settings other than throwing current settings and cache stuff in the bin. This is hardly acceptable for any developer.
  • I do NOT want to start a formatting war, I have been in too many with .NET fans, and it is useless. I want just to stick to the preferred project settings (if any).

It would be sufficient if one of the regular committers like Neil or Michael would simply export their settings
into a file in some well-known place in the repo and call it preferred settings. Root or a subdir would be fine. Then I could pick it up and easily conform to those settings. If I would add those settings to specific sub-projects, I will add them to .gitignore.

I must say that in some places the formatting of some sources is really off, making comprehensibility a lot harder, and impairing work on bug resolution. In particular, the reformatting stuff is difficult to understand because of the lack of doc on how things (should) work (compile/parse and diffing).

@mbien
Copy link
Member

mbien commented Jan 14, 2025

i am not sure if modules can inherit a repository wide formatter setting from the parent project. Only few modules come with their own formatter config:
https://github.com/search?q=repo%3Aapache%2Fnetbeans+%22auxiliary.org-netbeans-modules-editor%22&type=code

I am also not sure how to write all defaults into a property file, it seems to add only settings which were modified plus a few extra. Btw it is really easy to start NetBeans with default config. All you have to do is netbeans --userdir /tmp/tmpusr1.

@homberghp
Copy link
Contributor Author

Thanks for the tips.

Other than avoiding reformatting is there any other best practice you can advise?

Is there any need for a general cleanup? Documentation is a feature seldom asked for,
but I think it would make the life of contributers easier.
I could consider revisiting the source code files I visited while solving #7044 and enhance the documentation, or at least
add my understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature A feature request needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

3 participants