Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add dev container #23

Merged
merged 20 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
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"
}
34 changes: 34 additions & 0 deletions .github/workflows/check_format_and_lint.yml
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 .

42 changes: 42 additions & 0 deletions .vscode/launch.json
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"
}
]
}
43 changes: 43 additions & 0 deletions .vscode/settings.json
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,
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
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": []
}
]
}
Loading
Loading