Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vscode.sample/settings.json

Choose a reason for hiding this comment

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

this is IDE specific

I would not add this to the repo

whoever wants to work on this project does not need to use VSCode

Copy link
Member Author

Choose a reason for hiding this comment

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

what about

# https://EditorConfig.org
root = true
[*]
indent_size = 4
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{*.go,go.mod,Makefile}]
indent_style = unset
[{*.{yaml,yml},PROJECT,OWNERS}]
indent_size = 2
[{*.md,LICENSE}]
indent_size = unset

Copy link
Member Author

Choose a reason for hiding this comment

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

or readme? would that work better for you?

Copy link
Member Author

Choose a reason for hiding this comment

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

otherwise my IDE is throwing non matching linter errors due to newer golangci-lint picked up by IDE. I would still like to use IDE automatic linting integration with golangci-lint

Choose a reason for hiding this comment

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

.editorconfig is not IDE specific, is the config file for ec executable

oadp-non-admin/Makefile

Lines 261 to 263 in 47e640d

.PHONY: ec
ec: editorconfig ## Run file formatter checks against all project's files.
$(EC)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it's unreasonable to add .vscode/settings.json file to the project repository with some sensible defaults and at the same time ensure .gitignore contains this, so developers won't be adding their generated by the IDE changes. What I am wondering if it's possible to add it in a way it won't be pinning to a particular version (e.g. via the hack/) and use it in all the places, so we don't have to remember to bump the golangci binary every time. Here are few examples that already are within OpenShift org:

https://github.com/openshift/api/blob/635291d6fdf1c4f4cb2b94b460f8d4f9cc377571/.vscode/settings.json#L4

https://github.com/openshift/console/blob/e9d6ead6852600993cffef3d50cb9b122d64c068/frontend/.vscode/settings.json#L4

https://github.com/openshift/cluster-network-operator/blob/d09028dfda8c632e4c4730319b9f07f0ac92d82a/.vscode/settings.json#L3

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"go.lintTool": "golangci-lint",
"go.alternateTools": {
"golangci-lint": "${workspaceFolder}/bin/golangci-lint-v1.62.2" // corresponds to golangci-lint in Makefile
},
}