Skip to content

Commit

Permalink
Merge pull request #2 from dnv-opensource/1-add-settings-for-vs-code-…
Browse files Browse the repository at this point in the history
…and-pycharm-editors

1 add settings for vs code and pycharm editors
  • Loading branch information
tomarnepedersen authored Nov 23, 2023
2 parents d9d2124 + a8f0262 commit 7fa336b
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,yaml}]
indent_style = space
indent_size = 2
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -101,5 +102,13 @@ ENV/
# mypy
.mypy_cache/

# IDE settings
.vscode/
# PyCharm
.idea

# VS Code Settings
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
17 changes: 17 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode",
"njqdev.vscode-python-typehint",
"charliermarsh.ruff",
"sourcery.sourcery",
"njpwerner.autodocstring",
"editorconfig.editorconfig"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
77 changes: 77 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Unit Test",
"type": "python",
"request": "launch",
"justMyCode": false,
"program": "${file}"
},
{
"name": "Python: Current File, cwd = file dir, envFile",
"type": "python",
"request": "launch",
"cwd": "${fileDirname}", // working dir = dir where current file is
"program": "${file}",
"console": "integratedTerminal",
"autoReload": {
"enable": true
},
"justMyCode": false,
"envFile": "${workspaceFolder}/.env", // specify where .env file is
},
{
"name": "Python: Current File, cwd = workspace root folder, envFile",
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}", // working dir = project root folder
"program": "${file}",
"console": "integratedTerminal",
"autoReload": {
"enable": true
},
"justMyCode": false,
"envFile": "${workspaceFolder}/.env", // specify where .env file is
},
{
"name": "trafficgen cli, cwd = tests, envFile",
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}\\tests",
"program": "${workspaceFolder}\\src\\trafficgen\\cli.py",
// "args": [
// "test_config_file",
// "--run",
// "-v",
// ],
"console": "integratedTerminal",
"autoReload": {
"enable": true
},
"justMyCode": false,
"envFile": "${workspaceFolder}/.env", // specify where .env file is
},
{
"name": "trafficgen cli, cwd = file dir, envFile",
"type": "python",
"request": "launch",
"cwd": "${fileDirname}", // working dir = dir where current file is
"program": "${workspaceFolder}\\src\\trafficgen\\cli.py",
// "args": [
// "test_config_file",
// "--run",
// "-v",
// ],
"console": "integratedTerminal",
"autoReload": {
"enable": true
},
"justMyCode": false,
"envFile": "${workspaceFolder}/.env", // specify where .env file is
},
]
}
47 changes: 47 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"terminal.integrated.env.windows": {
"PYTHONPATH": "${workspaceFolder}/src"
},
"python.terminal.activateEnvInCurrentTerminal": true,
"python.languageServer": "Pylance",
"ruff.importStrategy": "fromEnvironment",
"python.linting.enabled": false,
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
"autoDocstring.docstringFormat": "numpy",
"python.testing.pytestEnabled": true,
"python.analysis.logLevel": "Warning",
"python.analysis.completeFunctionParens": false,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.diagnosticSeverityOverrides": {},
"python.analysis.indexing": true,
"python.analysis.autoImportCompletions": true,
"python.analysis.autoImportUserSymbols": true,
"python.analysis.inlayHints.variableTypes": false,
"python.analysis.inlayHints.functionReturnTypes": false,
"python.analysis.inlayHints.pytestParameters": true,
"python.terminal.executeInFileDir": true,
"python.analysis.packageIndexDepths": [
{
"name": "pandas",
"depth": 4,
"includeAllSymbols": true,
},
{
"name": "matplotlib",
"depth": 4,
"includeAllSymbols": true,
},
{
"name": "mpl_toolkits",
"depth": 4,
"includeAllSymbols": true,
},
],
}

0 comments on commit 7fa336b

Please sign in to comment.