Skip to content

Commit

Permalink
Merge pull request #47 from a5chin/feature/docs
Browse files Browse the repository at this point in the history
Create docs
  • Loading branch information
a5chin authored Dec 20, 2024
2 parents 5b9f413 + 63229ef commit 4e11de2
Show file tree
Hide file tree
Showing 33 changed files with 1,321 additions and 12 deletions.
20 changes: 20 additions & 0 deletions .github/actions/setup-git-config/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Configure Git Credentials
description: |
This GitHub Action sets the Git user name and user email.
inputs:
name:
description: Git user name
required: true
email:
description: Git user email
required: true

runs:
using: composite
steps:
- name: Sets the Git user name and user email
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
shell: bash
41 changes: 41 additions & 0 deletions .github/workflows/gh-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy Docs

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

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git Credentials
uses: ./.github/actions/setup-git-config
with:
name: github-actions[bot]
email: 41898282+github-actions[bot]@users.noreply.github.com

- name: Setup Python 3.13 with uv
uses: ./.github/actions/setup-python-with-uv
with:
python-version: 3.13

- name: Generate cache id
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- name: Save cache
uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: mkdocs-material-

- run: uv run mkdocs gh-deploy --force
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
This repository contains configurations to set up a Python development environment using VSCode's Dev Container feature.
The environment includes uv, and Ruff.

![demo](assets/gif/ruff.gif)
![demo](docs/img/ruff.gif)

If the Ruff format does not work, try reloading the VS Code window.
Specifically, you can solve this problem by following the steps below.
Expand Down Expand Up @@ -144,12 +144,13 @@ uv add {libraries}
```
.
├── .devcontainer
│ ├── buildWithRust.Dockerfile
│ ├── devcontainer.json
│ └── Dockerfile
├── Dockerfile
├── .github
│ ├── actions
│ │ ├── setup-git-config
│ │ │ └── action.yml
│ │ └── setup-python-with-uv
│ │ └── action.yml
│ ├── dependabot.yml
Expand All @@ -159,6 +160,7 @@ uv add {libraries}
│ ├── ruff.yml
│ └── test.yml
├── .dockergitignore
├── docs/
├── .gitignore
├── LICENSE
├── .pre-commit-config.yaml
Expand Down
2 changes: 2 additions & 0 deletions docs/about/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# About
- [LICENSE](license.md)
23 changes: 23 additions & 0 deletions docs/about/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```
MIT License
Copyright (c) 2024 a5chin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
13 changes: 13 additions & 0 deletions docs/configurations/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configurations

!!! TIPS
Looking for a getting started guide? Check out the [Gettting Started](../getting-started/index.md) guide first.

Configurations for using Python with uv on Dev Container.
Learn more about using this repository:

- [Understanding uv Configure](uv.md)
- [Understanding Ruff Configure](ruff.md)
- [Understanding pre-commit Configure](pre-commit.md)
- [Understanding Pyright Configure](pyright.md)

43 changes: 43 additions & 0 deletions docs/configurations/pre-commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
!!! TIP
If you do not want to use the pre-commit hook, run this command:
```sh
pre-commit uninstall
```

## Hook List
- [https://github.com/astral-sh/ruff-pre-commit](https://github.com/astral-sh/ruff-pre-commit)
- Ruff Lint
- Ruff Format
- [https://github.com/hadolint/hadolint](https://github.com/hadolint/hadolint)
- Hadolint

## Overview
```{.yaml hl_lines=42-57 title=".pre-commit-config.yaml"}
default_stages: [pre-commit]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
hooks:
- id: ruff
name: Ruff check
description: "Run 'ruff check' for extremely fast Python linting"
args: [--fix]
- id: ruff-format
name: Ruff format
description: "Run 'ruff format' for extremely fast Python formatting"
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint
name: Lint Dockerfiles
description: Runs hadolint to lint Dockerfiles
language: system
types: ["dockerfile"]
entry: hadolint
ci:
autoupdate_schedule: weekly
```
23 changes: 23 additions & 0 deletions docs/configurations/pyright.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
!!! TIP
Official documentation for Pyright is available at [https://microsoft.github.io/pyright](https://microsoft.github.io/pyright)

!!! DANGER
If you want to create new directories in the root directory, you must add them to the `include` list in the `pyrightconfig.json` file.

```{.json title="pyrightconfig.json"}
{
"pythonVersion": "3.12",
"pythonPlatform": "All",
"venv": ".venv",
"typeCheckingMode": "standard",
"include": [
"tools"
],
"exclude": [
"**/__pycache__",
".pytest_cache",
".ruff_cache",
".venv"
],
}
```
Loading

0 comments on commit 4e11de2

Please sign in to comment.