[SERVER-72810] add "files.insertFinalNewline" to linux-virtual-workstation.code-workspace Created: 12/Jan/23  Updated: 29/Oct/23  Resolved: 13/Jan/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Alex Neben
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-55281 restore lint enforcement of newlines ... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Per the wiki for VSCode setup, it's pretty much required that everyone's producing pedantically valid text files. That is, there should be a newline terminating the last line of every text file we check in.

So developer VS Code should always be set up with:

    "files.insertFinalNewline": true,

When I wrote that suggestion in the wiki, I deeply wished I had a way to make this a default on every developer's VSCode, but we didn't have that ability until now.

So can we add this to the .vscode_defaults/linux-virtual-workstation.code-workspace file please?

PS: Thanks for your work getting something in place to ease the historically complex vscode setup experience for our virtual workstations!

PPS: the .vscode_defaults/linux-virtual-workstation.code-workspace file itself needs a trailing newline. This may seem pedantic but it's an issue that affects scripting and tooling pipelines etc (see SERVER-55281) that's best avoided. For example:

$ tail .vscode_defaults/linux-virtual-workstation.code-workspace ; echo "<= Am I alone on this line? =>"
        "extensions": {
                "recommendations": [
                        "llvm-vs-code-extensions.vscode-clangd",
                        "dbaeumer.vscode-eslint",
                        "ms-python.python",
                        "xaver.clang-format",
                        "notskm.clang-tidy"
                ]
        }
}<= Am I alone on this line? =>



 Comments   
Comment by Githook User [ 13/Jan/23 ]

Author:

{'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'}

Message: SERVER-72810 Added extra newline when saving vscode
Branch: master
https://github.com/mongodb/mongo/commit/8fe92113e8612a6b0c5c9eba31ab99aec86b4ed2

Generated at Thu Feb 08 06:22:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.