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

Default line lenght does not match gdformat default #10

Closed
chrisl8 opened this issue Mar 24, 2024 · 5 comments
Closed

Default line lenght does not match gdformat default #10

chrisl8 opened this issue Mar 24, 2024 · 5 comments

Comments

@chrisl8
Copy link
Contributor

chrisl8 commented Mar 24, 2024

As of this PR #9 the default line length is now 80, but the default built into gdformat is 100, so after updating this extension in VSCode all of my files start changing their formatting without me asking for that.

What I would really rather see is putting settings like this into a config file that is committed to the code base, so that every developer who clones the code would use the same settings. Otherwise it is easy for people trying to make PRs to accidentally commit a bunch of formatting changes to your code that you don't want because they didn't edit their VSCode settings.

gdformat does have a config file now Scony/godot-gdscript-toolkit#286 so I could ask to add line length to it, however it would also be nice to be able to read and update the config file from the settings menu. Does that even make sense?

TL;DR: VSCode settings that affect how other developers working on your code will commit seem bad to me, unless there is an easy and accepted way to get these settings into the git repository of the code base.

@EddieDover
Copy link
Owner

EddieDover commented Mar 24, 2024

I agree this is something that could and should be looked into. For now, would an acceptable compromise be bumping the default line length in the package.json to match that of the toolkit?

@chrisl8
Copy link
Contributor Author

chrisl8 commented Mar 24, 2024

Ideally, in my mind, the extension would not pass any line length at all unless one was "set" in the settings. It seems like the current code always sets something.

Yes, setting the default in the extension to match the default from gdformat would cover for the issue, but seems like a "hack".
Practically though, yes, that would do the trick.

I've also discovered now that many people suggest committing the .vscode folder into a repository, so maybe that is the simple answer, to set it in the Workspace area and commit it.

@EddieDover
Copy link
Owner

Again, I agree with you but I won't have any bandwidth to personally look into it until next weekend. If you'd like to take a wack at it, I'd welcome a PR.

@EddieDover
Copy link
Owner

I've also discovered now that many people suggest committing the .vscode folder into a repository, so maybe that is the simple answer, to set it in the Workspace area and commit it.

Honestly, this is the solution I'd go with. The extension will read modifications in the settings.json, so setting it via the workspace is probably the best bet. I've always committed my .vscode folder.

However, if we've decided this isn't a good enough solution by next weekend, then I will change things so that the config priority is the gdlint config if it exists then the workspace settings.

@chrisl8
Copy link
Contributor Author

chrisl8 commented Mar 27, 2024

Thanks! If I decide I need anything fancier myself I'll make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants