-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(dev_container): Add dev container and launch settings. * feat(launch_config): Add additional launch configs. * feat(project_config): Add ruff max line length * delete * feat(ruff): Add additional settings * feat(dev_container): Add some extensions and settings. * feat(dev_container_settings): Add some project settings * feat(project_settings): Add some additional workspace settings. * feat(dev_container): Add dev requirements * refac(project): Change project based on pylance and ruff errors. * refac(dev_container): Remove pylance since this extension is auto installed by pathon. * feat(license): Change license to gnu * refac(dev_container): Remove no longer needed extension * feat(tasks): Add ruff task to format all files. * cicd(linter): Add action to check code with ruff * feat(tasks): Add ruff lint task to project * feat(ruff): Add some linter settings. * refac(ruff): Format all files with ruff. * feat(license): Remove license * fix(cicd): Add checkout to linter action.
- Loading branch information
Showing
21 changed files
with
333 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "Python 3", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm", | ||
"features": { | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/wxw-matt/devcontainer-features/command_runner:0": {}, | ||
"ghcr.io/devcontainers-contrib/features/pylint:2": {}, | ||
"ghcr.io/akhildevelops/devcontainer-features/pip:0": {}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "pip3 install --user -r requirements.txt && pip3 install --user -r requirements-dev.txt", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"njpwerner.autodocstring", | ||
"Gruntfuggly.todo-tree", | ||
"GitHub.copilot", | ||
"github.vscode-github-actions", | ||
"GitHub.vscode-pull-request-github", | ||
"eamodio.gitlens", | ||
"zaaack.markdown-editor", | ||
"yzhang.markdown-all-in-one", | ||
"evendead.help-me-add", | ||
"charliermarsh.ruff", | ||
"streetsidesoftware.code-spell-checker", | ||
"njqdev.vscode-python-typehint" | ||
] | ||
} | ||
} | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- closed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check_code: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
- name: Check code format with ruff | ||
run: ruff format --check . | ||
|
||
- name: Check code with ruff | ||
run: ruff check . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "InfraPatch CLI: Report", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "infrapatch.cli", | ||
"args": [ | ||
"--debug", | ||
"report" | ||
], | ||
"justMyCode": true | ||
}, | ||
{ | ||
"name": "InfraPatch CLI: Update", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "infrapatch.cli", | ||
"args": [ | ||
"--debug", | ||
"update" | ||
], | ||
"justMyCode": true | ||
}, | ||
{ | ||
"name": "InfraPatch CLI: custom", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "infrapatch.cli", | ||
"args": "${input:custom_args}", | ||
"justMyCode": true | ||
} | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "custom_args", | ||
"description": "Space separated list of arguments to pass to the infrapatch cli", | ||
"type": "promptString" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"terminal.integrated.env.osx": { | ||
"PYTHONPATH": "${workspaceFolder}", | ||
}, | ||
"terminal.integrated.env.linux": { | ||
"PYTHONPATH": "${workspaceFolder}", | ||
}, | ||
"terminal.integrated.env.windows": { | ||
"PYTHONPATH": "${workspaceFolder}", | ||
}, | ||
"[python]": { | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true, | ||
"source.organizeImports": true | ||
}, | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
}, | ||
"files.autoSave": "afterDelay", | ||
"python.analysis.inlayHints.functionReturnTypes": true, | ||
"python.analysis.inlayHints.pytestParameters": true, | ||
"python.analysis.inlayHints.variableTypes": true, | ||
"python.languageServer": "Default", | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"python.missingPackage.severity": "Error", | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
"cSpell.words": [ | ||
"infrapatch" | ||
], | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true, | ||
"python.analysis.autoImportCompletions": true, | ||
"python.analysis.fixAll": [ | ||
"source.unusedImports", | ||
"source.convertImportFormat" | ||
], | ||
"python.analysis.typeCheckingMode": "basic", | ||
"python.analysis.diagnosticMode": "workspace", | ||
"editor.guides.indentation": false, | ||
"editor.guides.bracketPairs": true, | ||
"editor.guides.highlightActiveBracketPair": true, | ||
"editor.guides.bracketPairsHorizontal": false, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "format with ruff", | ||
"type": "shell", | ||
"command": "ruff", | ||
"args": [ | ||
"format", | ||
"." | ||
], | ||
"presentation": { | ||
"reveal": "always" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "ruff lint project", | ||
"type": "shell", | ||
"command": "ruff", | ||
"args": [ | ||
"check", | ||
"." | ||
], | ||
"presentation": { | ||
"reveal": "always" | ||
}, | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
Oops, something went wrong.