Skip to content

Commit

Permalink
Merge pull request #39 from a5chin/feature/refactor
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
a5chin authored Oct 10, 2024
2 parents c7704f9 + 8cc9ffc commit c46d535
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 39 deletions.
4 changes: 1 addition & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ WORKDIR /opt
# The installer requires curl (and certificates) to download the release archive
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl
apt-get install -y --no-install-recommends ca-certificates curl

SHELL [ "/bin/bash", "-o", "pipefail", "-c" ]

Expand Down
18 changes: 1 addition & 17 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,22 @@
"kevinrose.vsc-python-indent",
"mosapride.zenkaku",
"ms-azuretools.vscode-docker",
"ms-pyright.pyright",
"ms-python.python",
"njpwerner.autodocstring",
"oderwat.indent-rainbow",
"pkief.material-icon-theme",
"redhat.vscode-yaml",
"shardulm94.trailing-spaces",
"tamasfe.even-better-toml",
"usernamehw.errorlens",
"yzhang.markdown-all-in-one"
],
"settings": {
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"python.defaultInterpreterPath": "/root/.local/share/uv/python",
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml",
"editor.formatOnSave": true,
"editor.insertSpaces": true
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
},
"editor.formatOnSave": true
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/setup-python-with-uv/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Install Python with uv
description: |
This GitHub Action installs Python using the uv tool.
It pins the specified Python version, caches uv files, and installs dependencies.
inputs:
python-version:
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:

updates:
- package-ecosystem: pip
directory: "/"
schedule:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docker

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
lint:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Pyright

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
type-check:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: Ruff

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout
Expand All @@ -31,7 +31,7 @@ jobs:

strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: Test

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
pytest:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
default_stages: [commit]

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: ruff
name: Ruff check
description: "Run 'ruff check' for extremely fast Python linting"
args: [ --fix ]
args: [--fix]

- id: ruff-format
name: Ruff format
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"kevinrose.vsc-python-indent",
"mosapride.zenkaku",
"ms-azuretools.vscode-docker",
"ms-pyright.pyright",
"ms-python.python",
"ms-vscode-remote.remote-containers",
"njpwerner.autodocstring",
"oderwat.indent-rainbow",
"pkief.material-icon-theme",
"redhat.vscode-yaml",
"shardulm94.trailing-spaces",
"tamasfe.even-better-toml",
"usernamehw.errorlens",
Expand Down
44 changes: 44 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,60 @@
{
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"python.defaultInterpreterPath": ".venv/bin/python",
"[dockercompose]": {
"editor.autoIndent": "advanced",
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.tabSize": 4
},
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker",
"editor.formatOnSave": true
},
"[github-actions-workflow]": {
"editor.autoIndent": "advanced",
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.insertSpaces": true,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.tabSize": 2
},
"[json][jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4
},
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.tabSize": 4
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4
},
"[yaml]": {
"editor.autoIndent": "advanced",
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 2
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ Specifically, you can solve this problem by following the steps below.
- [mosapride.zenkaku](https://marketplace.visualstudio.com/items?itemName=mosapride.zenkaku)
- [ms-azuretools.vscode-docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)
- [ms-python.python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
- [ms-pyright.pyright](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright)
- [njpwerner.autodocstring](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring)
- [oderwat.indent-rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow)
- [pkief.material-icon-theme](https://marketplace.visualstudio.com/items?itemName=pkief.material-icon-theme)
- [redhat.vscode-yaml](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
- [shardulm94.trailing-spaces](https://marketplace.visualstudio.com/items?itemName=shardulm94.trailing-spaces)
- [tamasfe.even-better-toml](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml)
- [usernamehw.errorlens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens)
Expand Down
5 changes: 1 addition & 4 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"pythonPlatform": "All",
"venvPath": "./",
"venv": ".venv",

"include": [
],

"include": [],
"exclude": [
"**/__pycache__",
".pytest_cache",
Expand Down

0 comments on commit c46d535

Please sign in to comment.