News for hackers. Stuff that matters.
Re:Git ignores .gitignore with .gitignore in .gitignore by jameshart on Wednesday May 18, 2022 @09:15AM (#31422374)
'never' is a strong word.

A .vscode/extensions.json file just specifies extension 'recommendations', and I find, really accelerates developers becoming productive in a project.

If I want to encourage small, one-off contributions, I want to support a user workflow that's as close as possible to:

   git clone <project>
   git switch -t <branch>
   code <project>
   npm ci | dotnet restore | terraform init | go get | <whatever>
   <change and test>
   git add <changes>
   git commit
   git push
With the right set of extension recommendations and default code settings, a VS code user can automatically be prompted to get the right test executors, linters, prettifiers, and so on so that they get instant feedback on their changes.

It doesn't even matter if many users who work on the codebase day to day actually use emacs or a highly customized IntelliJ setup or whatever - the vscode settings specifically enable the driveby coder to get a working environment fast, and that helps enable the power users to not be bothered by feature requests that could be pull requests.

Re:Git ignores .gitignore with .gitignore in .gitignore by junon on Wednesday May 18, 2022 @09:52AM (#31422782)
Never is a strong word, and I mean it. No your fancy extensions mean nothing to many devs. That configuration is not required to run the code in the repository. Do not include it.
Re:Git ignores .gitignore with .gitignore in .gitignore by roykanesmith37 on Wednesday May 18, 2022 @11:11AM (#31423772)
Java projects can get complex and editors (like IntelliJ can provide much better tooling when configured).

At my last job we had a mono-repo with the .idea directory (for IntelliJ) commited. For Java projects IntelliJ needs to sometimes be directed to understand what folders are “resources” to allow better autocompletion and highlighting. For example specifying custom java faces components directory that will be used once the application is packaged into a war file, so IntelliJ knows they are accessible from JSP html files, and will autocomplete and show you what attributes you can modify on the component.

It’s definitely not a never situation. You can commit only certain files from the configuration (project settings not editor preferences)

Re:Git ignores .gitignore with .gitignore in .gitignore by jameshart on Wednesday May 18, 2022 @10:43AM (#31423405)
So... are you also against having any hints as to how to set up a working local dev environment in the README.md file? Because that's also not necessary to run the project, but it's a courtesy to contributors.

Also, the idea that there is some universal rule of 'what should be checked in to source control' that applies to EVERYTHING from personal projects to corporate internal monorepos to open source projects to undergrad joint coding projects to video games is... absurd.

Re:Git ignores .gitignore with .gitignore in .gitignore by junon on Wednesday May 18, 2022 @11:44AM (#31424172)
No, because that's documentation, but I think that was obvious.
Re:Git ignores .gitignore with .gitignore in .gitignore by jameshart on Wednesday May 18, 2022 @11:47AM (#31424206)
Well, no it's not obvious.

If I can provide machine readable documentation on how to get your VSCode environment set up (in the form of a .vscode/extensions.json file), isn't that strictly better than merely human-readable documentation in README.md under a 'Recommended VSCode Extensions to work with this project' header?

Re:Git ignores .gitignore with .gitignore in .gitignore by junon on Wednesday May 18, 2022 @12:41PM (#31424857)
No, because that doesn't translate to other IDEs and one user programmatically changing things to suit themselves causes fluff in PRs and diffs. You also can't guarantee every environment is going to respond correctly.
Re:Git ignores .gitignore with .gitignore in .gitignore by Hackbraten on Wednesday May 18, 2022 @01:19PM (#31425266)
One user programmatically changing things to suit themselves is supposed to do so in their user settings, which has precedence over the checked-in copy. That way, you have the best of both worlds: easy set-up for everyone who wants it but you can override it without touching the VCS.
Re:Git ignores .gitignore with .gitignore in .gitignore by Hackbraten on Thursday May 19, 2022 @03:34PM (#31439083)
Update: turns out the precedence rules are a little more subtle than I thought.

See also: https://code.visualstudio.com/docs/getstarted/settings#_sett...

Re:Git ignores .gitignore with .gitignore in .gitignore by DangitBobby on Thursday May 19, 2022 @12:17AM (#31430706)
Can you override user settings at the project level?
Re:Git ignores .gitignore with .gitignore in .gitignore by Hackbraten on Thursday May 19, 2022 @03:33PM (#31439057)
Yes, project-level (aka workspace) settings generally override user settings.

But then again, language-specific settings will trump all other settings. And that’s one way to override workspace-level settings in your user settings if you want.

Here’s a detailed list of all levels of settings in VS Code, ordered by precedence: https://code.visualstudio.com/docs/getstarted/settings#_sett...