From 04bd075dbc61b8fc04c82b1a8817458cd0daa4d4 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sun, 29 Dec 2024 22:01:34 +0900 Subject: [PATCH 1/9] feat: linter formatter setting Signed-off-by: Hayato Mizushima --- .editorconfig | 11 ++-- .github/PULL_REQUEST_TEMPLATE.md | 13 ++++ .github/workflows/lint-pull-request.yaml | 16 +++++ .github/workflows/pre-commit.yaml | 19 ++++++ .github/workflows/test-db.yaml | 75 ++++++++++++++++++++++++ .gitignore | 2 +- .markdownlint.yaml | 11 ++++ .pre-commit-config.yaml | 52 ++++++++++++++++ .vscode/extensions.json | 12 ++++ .vscode/settings.json | 29 +++++++++ .yamllint.yaml | 22 +++++++ 11 files changed, 257 insertions(+), 5 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/lint-pull-request.yaml create mode 100644 .github/workflows/pre-commit.yaml create mode 100644 .github/workflows/test-db.yaml create mode 100644 .markdownlint.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 .yamllint.yaml diff --git a/.editorconfig b/.editorconfig index 0c6749c..3ed1eed 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,9 +4,12 @@ root = true charset = utf-8 end_of_line = lf indent_style = space -indent_size = 4 -trim_trailing_whitespace = true +indent_size = 2 insert_final_newline = true +trim_trailing_whitespace = true -[*.yml] -indent_size = 2 +[*.md] +trim_trailing_whitespace = false + +[*.py] +indent_size = 4 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..72a2d2e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ +## Types of PR + +- [ ] New Features +- [ ] Upgrade of existing features +- [ ] Bugfix + +## Description + +## How to review this PR + +All required checks by github actions have been passed. + +## Others diff --git a/.github/workflows/lint-pull-request.yaml b/.github/workflows/lint-pull-request.yaml new file mode 100644 index 0000000..695c8d3 --- /dev/null +++ b/.github/workflows/lint-pull-request.yaml @@ -0,0 +1,16 @@ +name: lint-pull-request + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + lint-pull-request: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..cc708fc --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,19 @@ +name: pre-commit + +on: + pull_request: + workflow_dispatch: + +jobs: + pre-commit: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/test-db.yaml b/.github/workflows/test-db.yaml new file mode 100644 index 0000000..8f475ec --- /dev/null +++ b/.github/workflows/test-db.yaml @@ -0,0 +1,75 @@ +name: test-db + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test-db: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Docker Compose + run: | + sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + + - name: Start services with Docker Compose + run: docker-compose -f projects/artdb/compose.yaml up -d + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + uv python install 3.12 + + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ steps.generate-token.outputs.token }} + + - name: Install dependencies with uv + run: | + uv tool install . + + - name: Install mise to load .env file + run: | + curl https://mise.run | sh + echo 'eval "$(/home/runner/.local/bin/mise activate bash)"' >> /home/runner/.bashrc + + - name: Run database migrations + run: | + source ~/.bashrc + eval "$(mise env)" + uv run alembic upgrade head + working-directory: projects/artdb + + - name: Run model tests + run: | + uv run pytest projects/artdb/test/models + + - name: Run DB integration tests + run: | + uv run pytest projects/artdb/test/integration + + - name: Run API tests + run: | + uv run pytest projects/artapi/test/ diff --git a/.gitignore b/.gitignore index 1d74e21..8b13789 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.vscode/ + diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..babaaa1 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,11 @@ +# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules. +default: true +MD013: false +MD024: + siblings_only: true +MD029: + style: ordered +MD033: false +MD041: false +MD046: false +MD049: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0a6a824 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,52 @@ +ci: + autofix_commit_msg: "style(pre-commit): autofix" + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-json + - id: check-merge-conflict + - id: check-toml + - id: check-xml + - id: check-yaml + args: [--unsafe] + - id: detect-private-key + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.42.0 + hooks: + - id: markdownlint + args: [-c, .markdownlint.yaml, --fix] + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + + - repo: https://github.com/adrienverge/yamllint + rev: v1.35.1 + hooks: + - id: yamllint + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck + + - repo: https://github.com/scop/pre-commit-shfmt + rev: v3.9.0-1 + hooks: + - id: shfmt + args: [-w, -s, -i=4] + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.0 # Match the version used by the vscode extension. Otherwise, the editor and the command may say different things. + hooks: + - id: ruff + args: [--fix] + - id: ruff-format diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..499e5b4 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,12 @@ +{ + "recommendations": [ + "charliermarsh.ruff", + "bierner.markdown-mermaid", + "bpruitt-goddard.mermaid-markdown-syntax-highlighting" + ], + "unwantedRecommendations": [ + "ms-python.isort", + "ms-python.black-formatter", + "ms-python.flake8" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..47bfbdc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,29 @@ +{ + "cSpell.languageSettings": [ + { + "languageId": "c,cpp,python", + "allowCompoundWords": false + } + ], + "editor.formatOnSave": false, + "[python]": { + "editor.tabSize": 4, + "editor.formatOnType": true, + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.organizeImports": "explicit", + "source.organizeImports.ruff": "explicit" + }, + "editor.defaultFormatter": "charliermarsh.ruff" + }, + "python.autoComplete.extraPaths": [ + "${workspaceFolder}/.venv/lib/**/site-packages/", + "${workspaceFolder}/projects/**/src/" + ], + "python.analysis.extraPaths": [ + "${workspaceFolder}/.venv/lib/**/site-packages/", + "${workspaceFolder}/projects/**/src/" + ] +} diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..2c7bd08 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,22 @@ +extends: default + +ignore: | + *.param.yaml + +rules: + braces: + level: error + max-spaces-inside: 1 # To format with Prettier + comments: + level: error + min-spaces-from-content: 1 # To be compatible with C++ and Python + document-start: + level: error + present: false # Don't need document start markers + line-length: disable # Delegate to Prettier + truthy: + level: error + check-keys: false # To allow 'on' of GitHub Actions + quoted-strings: + level: error + required: only-when-needed # To keep consistent style From c8088588881fdfc9b6b0b0719df630a6bd8ec7a7 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sun, 29 Dec 2024 22:06:51 +0900 Subject: [PATCH 2/9] fix: lint Signed-off-by: Hayato Mizushima --- .gitignore | 1 - ansible/roles/browser/tasks/main.yml | 8 ++-- ansible/roles/desktop/tasks/main.yml | 24 +++++------ ansible/roles/desktop/tasks/multimedia.yml | 4 +- ansible/roles/dev_desktop/tasks/docker.yml | 16 ++++---- ansible/roles/dev_desktop/tasks/podman.yml | 4 +- ansible/roles/dev_desktop/tasks/vscode.yml | 10 ++--- ansible/roles/development/tasks/main.yml | 9 ++--- ansible/roles/development/tasks/python.yml | 5 +-- ansible/roles/development/tasks/ros.yml | 2 +- ansible/roles/development/tasks/rust.yml | 4 +- ansible/roles/dotfiles/tasks/main.yml | 13 +++--- ansible/roles/japanese/tasks/main.yml | 12 +++--- ansible/roles/mac/tasks/main.yml | 8 ++-- ansible/roles/remote/tasks/main.yml | 2 +- ansible/roles/remote/tasks/ssh-server.yml | 14 +++---- ansible/roles/system/tasks/main.yml | 10 ++--- ansible/roles/wsl/tasks/main.yml | 16 ++++---- ansible/ubuntu.yml | 1 - post_setup.sh | 1 - tips/backup.md | 46 +++++++++++----------- 21 files changed, 101 insertions(+), 109 deletions(-) diff --git a/.gitignore b/.gitignore index 8b13789..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ - diff --git a/ansible/roles/browser/tasks/main.yml b/ansible/roles/browser/tasks/main.yml index bcdfd91..68b4885 100644 --- a/ansible/roles/browser/tasks/main.yml +++ b/ansible/roles/browser/tasks/main.yml @@ -1,6 +1,5 @@ - - name: brave apt key - become: yes + become: true block: - ansible.builtin.get_url: url: https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg @@ -10,10 +9,9 @@ repo: "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" state: present - - name: install brave using apt - become: yes + become: true ansible.builtin.apt: name: - brave-browser - update_cache: yes \ No newline at end of file + update_cache: true diff --git a/ansible/roles/desktop/tasks/main.yml b/ansible/roles/desktop/tasks/main.yml index 75e4472..60cf3f4 100644 --- a/ansible/roles/desktop/tasks/main.yml +++ b/ansible/roles/desktop/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: install desktop tools using apt - become: yes + become: true ansible.builtin.apt: name: - cinnamon-desktop-environment @@ -13,19 +13,19 @@ - thunderbird-locale-ja - winbind - zstd - update_cache: yes + update_cache: true - name: add grub-customizer ppa - become: yes + become: true ansible.builtin.apt_repository: repo: ppa:danielrichter2007/grub-customizer state: present - name: install grub-customizer - become: yes + become: true ansible.builtin.apt: name: grub-customizer - update_cache: yes + update_cache: true - name: set cinnamon env default terminal community.general.dconf: @@ -52,42 +52,42 @@ state: present - name: disable sleep when close note pc display - become: yes + become: true ansible.builtin.lineinfile: path: /etc/systemd/logind.conf line: "HandleLidSwitch=ignore" insertafter: EOF - name: set clock local for Windows dual boot system - become: yes + become: true community.general.timezone: name: Asia/Tokyo hwclock: local - name: setting for winbind - become: yes + become: true ansible.builtin.replace: path: /etc/nsswitch.conf regexp: " dns$" replace: " dns wins" - name: add chrome apt key - become: yes + become: true ansible.builtin.apt_key: url: https://dl-ssl.google.com/linux/linux_signing_key.pub state: present - name: add chrome apt repository - become: yes + become: true ansible.builtin.apt_repository: repo: "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" filename: "google-chrome" state: present - name: install google-chrome - become: yes + become: true ansible.builtin.apt: name: google-chrome-stable - update_cache: yes + update_cache: true - import_tasks: multimedia.yml diff --git a/ansible/roles/desktop/tasks/multimedia.yml b/ansible/roles/desktop/tasks/multimedia.yml index 6c7d465..6eac61c 100644 --- a/ansible/roles/desktop/tasks/multimedia.yml +++ b/ansible/roles/desktop/tasks/multimedia.yml @@ -1,6 +1,6 @@ --- - name: install multimedia applications using apt - become: yes + become: true ansible.builtin.apt: name: - flameshot @@ -8,4 +8,4 @@ - libxcb-cursor0 # calibre dependency - obs-studio - vlc - update_cache: yes + update_cache: true diff --git a/ansible/roles/dev_desktop/tasks/docker.yml b/ansible/roles/dev_desktop/tasks/docker.yml index c73f2a2..5c1cae9 100644 --- a/ansible/roles/dev_desktop/tasks/docker.yml +++ b/ansible/roles/dev_desktop/tasks/docker.yml @@ -1,6 +1,6 @@ --- - name: install docker build dependencies - become: yes + become: true ansible.builtin.apt: name: - apt-transport-https @@ -8,31 +8,31 @@ - curl - gnupg - lsb-release - update_cache: yes + update_cache: true - name: add docker apt key - become: yes + become: true ansible.builtin.apt_key: - url: 'https://download.docker.com/linux/ubuntu/gpg' + url: "https://download.docker.com/linux/ubuntu/gpg" state: present - name: add docker repository - become: yes + become: true ansible.builtin.apt_repository: repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_facts['distribution_release'] }} stable" - name: install docker - become: yes + become: true ansible.builtin.apt: name: - docker-ce - docker-ce-cli - containerd.io - docker-compose-plugin - update_cache: yes + update_cache: true - name: add {{ ansible_facts['user_id'] }} to docker group - become: yes + become: true ansible.builtin.user: name: "{{ ansible_facts['user_id'] }}" groups: docker diff --git a/ansible/roles/dev_desktop/tasks/podman.yml b/ansible/roles/dev_desktop/tasks/podman.yml index 2ae6bd0..ee0ebbd 100644 --- a/ansible/roles/dev_desktop/tasks/podman.yml +++ b/ansible/roles/dev_desktop/tasks/podman.yml @@ -1,6 +1,6 @@ - name: install podman - become: yes + become: true ansible.builtin.apt: name: - podman - update_cache: yes + update_cache: true diff --git a/ansible/roles/dev_desktop/tasks/vscode.yml b/ansible/roles/dev_desktop/tasks/vscode.yml index e24991a..83572e0 100644 --- a/ansible/roles/dev_desktop/tasks/vscode.yml +++ b/ansible/roles/dev_desktop/tasks/vscode.yml @@ -1,26 +1,26 @@ --- - name: add vscode key - become: yes + become: true ansible.builtin.apt_key: - url: 'https://packages.microsoft.com/keys/microsoft.asc' + url: "https://packages.microsoft.com/keys/microsoft.asc" state: present - name: add VS Code repo - become: yes + become: true ansible.builtin.apt_repository: repo: "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" filename: vscode state: present - name: install vscode dependencies - become: yes + become: true ansible.builtin.apt: name: - apt-transport-https state: present - name: install VS Code - become: yes + become: true ansible.builtin.apt: name: code state: present diff --git a/ansible/roles/development/tasks/main.yml b/ansible/roles/development/tasks/main.yml index 4106a5f..4ad7281 100644 --- a/ansible/roles/development/tasks/main.yml +++ b/ansible/roles/development/tasks/main.yml @@ -1,6 +1,5 @@ ---- - name: install develop tools - become: yes + become: true ansible.builtin.apt: name: - cmake @@ -8,20 +7,20 @@ - sqlitebrowser - upx - ccache - update_cache: yes + update_cache: true - import_tasks: python.yml - import_tasks: rust.yml - import_tasks: ros.yml - name: copy cyclonedds.conf for ros2 - become: yes + become: true ansible.builtin.copy: src: 60_cyclonedds.conf dest: /etc/sysctl.d/60_cyclonedds.conf - name: change ifconfig permission - become: yes + become: true ansible.builtin.file: path: /usr/sbin/ifconfig mode: 04755 diff --git a/ansible/roles/development/tasks/python.yml b/ansible/roles/development/tasks/python.yml index b44e33d..f7cb5b3 100644 --- a/ansible/roles/development/tasks/python.yml +++ b/ansible/roles/development/tasks/python.yml @@ -1,6 +1,5 @@ ---- - name: python3 packages - become: yes + become: true ansible.builtin.apt: name: - python3-pip @@ -8,4 +7,4 @@ - python3-pytest - python3-pytest-repeat - python3-pytest-rerunfailures - update_cache: yes + update_cache: true diff --git a/ansible/roles/development/tasks/ros.yml b/ansible/roles/development/tasks/ros.yml index c5e547b..c779586 100644 --- a/ansible/roles/development/tasks/ros.yml +++ b/ansible/roles/development/tasks/ros.yml @@ -4,6 +4,6 @@ dest: /tmp/lichtblick.deb - name: Install lichtblick deb package - become: yes + become: true ansible.builtin.apt: deb: /tmp/lichtblick.deb diff --git a/ansible/roles/development/tasks/rust.yml b/ansible/roles/development/tasks/rust.yml index 8243df2..9a13f21 100644 --- a/ansible/roles/development/tasks/rust.yml +++ b/ansible/roles/development/tasks/rust.yml @@ -9,8 +9,8 @@ ansible.builtin.get_url: url: https://sh.rustup.rs dest: /tmp/sh.rustup.rs - mode: '0755' - force: 'yes' + mode: "0755" + force: "yes" tags: - rust diff --git a/ansible/roles/dotfiles/tasks/main.yml b/ansible/roles/dotfiles/tasks/main.yml index 73bf2dd..155db12 100644 --- a/ansible/roles/dotfiles/tasks/main.yml +++ b/ansible/roles/dotfiles/tasks/main.yml @@ -1,10 +1,9 @@ ---- - name: install git latest - become: yes + become: true ansible.builtin.apt: name: git - update_cache: yes - when: "ansible_facts['distribution'] == 'Ubuntu'" + update_cache: true + when: ansible_facts['distribution'] == 'Ubuntu' - name: clone dotfiles ansible.builtin.git: @@ -13,10 +12,10 @@ - name: create .ssh directory ansible.builtin.file: - path: "~/.ssh" + path: ~/.ssh state: directory - name: copy known_hosts ansible.builtin.copy: - src: known_hosts - dest: ~/.ssh + src: known_hosts + dest: ~/.ssh diff --git a/ansible/roles/japanese/tasks/main.yml b/ansible/roles/japanese/tasks/main.yml index 7ddfa60..f2cfe01 100644 --- a/ansible/roles/japanese/tasks/main.yml +++ b/ansible/roles/japanese/tasks/main.yml @@ -1,35 +1,35 @@ - name: Add Ubuntu Japanese PPA keyring - become: yes + become: true ansible.builtin.apt_key: url: https://www.ubuntulinux.jp/ubuntu-jp-ppa-keyring.gpg state: present when: "ansible_facts['distribution_release'] == 'jammy'" - name: Add Ubuntu Japanese archive keyring - become: yes + become: true ansible.builtin.apt_key: url: https://www.ubuntulinux.jp/ubuntu-ja-archive-keyring.gpg state: present when: "ansible_facts['distribution_release'] == 'jammy'" - name: Download Ubuntu Japanese repository - become: yes + become: true ansible.builtin.get_url: url: "https://www.ubuntulinux.jp/sources.list.d/jammy.list" dest: /etc/apt/sources.list.d/ubuntu-ja.list when: "ansible_facts['distribution_release'] == 'jammy'" - name: Download Ubuntu Japanese repository - become: yes + become: true ansible.builtin.get_url: url: "https://www.ubuntulinux.jp/sources.list.d/noble.sources" dest: /etc/apt/sources.list.d/ubuntu-ja.sources when: "ansible_facts['distribution_release'] == 'noble'" - name: install ja package - become: yes + become: true ansible.builtin.apt: name: - ubuntu-defaults-ja - language-pack-ja - update_cache: yes + update_cache: true diff --git a/ansible/roles/mac/tasks/main.yml b/ansible/roles/mac/tasks/main.yml index 70915b1..3726f51 100644 --- a/ansible/roles/mac/tasks/main.yml +++ b/ansible/roles/mac/tasks/main.yml @@ -5,11 +5,11 @@ - name: update homebrew community.general.homebrew: - update_homebrew: yes + update_homebrew: true - name: brew install community.general.homebrew: - name: '{{ item }}' + name: "{{ item }}" state: present with_items: - fish @@ -29,9 +29,9 @@ - name: install homebrew cask packages community.general.homebrew_cask: - name: '{{ item }}' + name: "{{ item }}" state: present - install_options: 'appdir=/Applications' + install_options: appdir=/Applications with_items: - db-browser-for-sqlite - google-japanese-ime diff --git a/ansible/roles/remote/tasks/main.yml b/ansible/roles/remote/tasks/main.yml index a1a0294..77927f9 100644 --- a/ansible/roles/remote/tasks/main.yml +++ b/ansible/roles/remote/tasks/main.yml @@ -6,6 +6,6 @@ dest: /tmp/chrome-remote-desktop.deb - name: Install chrome-remote-desktop deb package - become: yes + become: true ansible.builtin.apt: deb: /tmp/chrome-remote-desktop.deb diff --git a/ansible/roles/remote/tasks/ssh-server.yml b/ansible/roles/remote/tasks/ssh-server.yml index 2257417..ca3d843 100644 --- a/ansible/roles/remote/tasks/ssh-server.yml +++ b/ansible/roles/remote/tasks/ssh-server.yml @@ -1,6 +1,6 @@ --- - name: install openssh-server - become: yes + become: true ansible.builtin.apt: name: openssh-server @@ -8,37 +8,37 @@ ansible.builtin.file: path: ~/.ssh state: directory - mode: '700' + mode: "700" - name: update ssh settings (2/6) ansible.builtin.copy: src: authorized_keys dest: ~/.ssh/authorized_keys - mode: '600' + mode: "600" - name: update ssh settings (3/6) - become: yes + become: true ansible.builtin.replace: path: /etc/ssh/sshd_config regexp: "^#Port 22" replace: "Port {{ lookup('env', 'ssh_port') }}" - name: update ssh settings (4/6) - become: yes + become: true ansible.builtin.replace: path: /etc/ssh/sshd_config regexp: "^#AuthorizedKeysFile" replace: "AuthorizedKeysFile" - name: update ssh settings (5/6) - become: yes + become: true ansible.builtin.replace: path: /etc/ssh/sshd_config regexp: "^#PasswordAuthentication yes" replace: "PasswordAuthentication no" - name: update ssh settings (6/6) - become: yes + become: true ansible.builtin.replace: path: /etc/ssh/sshd_config regexp: "PermitRootLogin prohibit-password" diff --git a/ansible/roles/system/tasks/main.yml b/ansible/roles/system/tasks/main.yml index 7a7c9cd..2e92aef 100644 --- a/ansible/roles/system/tasks/main.yml +++ b/ansible/roles/system/tasks/main.yml @@ -3,7 +3,7 @@ ansible.builtin.shell: LANG=C xdg-user-dirs-update --force - name: install system tools using apt - become: yes + become: true ansible.builtin.apt: name: - htop @@ -14,19 +14,19 @@ - ripgrep - libfuse2 # https://syohex.hatenablog.com/entry/2022/05/02/230822 - tree - update_cache: yes + update_cache: true - name: add fish ppa - become: yes + become: true ansible.builtin.apt_repository: repo: ppa:fish-shell/release-3 state: present - name: install fish shell - become: yes + become: true ansible.builtin.apt: name: fish - update_cache: yes + update_cache: true - name: install fisher ansible.builtin.shell: curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher diff --git a/ansible/roles/wsl/tasks/main.yml b/ansible/roles/wsl/tasks/main.yml index 4d3545e..318a7fc 100644 --- a/ansible/roles/wsl/tasks/main.yml +++ b/ansible/roles/wsl/tasks/main.yml @@ -1,31 +1,31 @@ --- - name: copy font conf - become: yes + become: true ansible.builtin.copy: src: local.conf dest: /etc/fonts/local.conf - name: Ensure a locale exists - become: yes + become: true community.general.locale_gen: name: ja_JP.UTF-8 state: present - name: keyboard setting - become: yes + become: true ansible.builtin.command: localectl set-x11-keymap jp jp106 - name: change locale - become: yes + become: true ansible.builtin.command: update-locale LANG=ja_JP.UTF-8 - name: install input method - become: yes + become: true ansible.builtin.apt: name: - fcitx-mozc - x11-xserver-utils - update_cache: yes + update_cache: true - name: input method setting ansible.builtin.blockinfile: @@ -41,8 +41,8 @@ fi - name: unzip - become: yes + become: true ansible.builtin.apt: name: - unzip - update_cache: yes + update_cache: true diff --git a/ansible/ubuntu.yml b/ansible/ubuntu.yml index 9cc2eee..1e50f8c 100644 --- a/ansible/ubuntu.yml +++ b/ansible/ubuntu.yml @@ -27,4 +27,3 @@ when: prompt_dev == 'y' and prompt_wsl != 'y' - role: remote when: prompt_remote == 'y' - diff --git a/post_setup.sh b/post_setup.sh index 4ce9f03..9f05a9f 100755 --- a/post_setup.sh +++ b/post_setup.sh @@ -17,4 +17,3 @@ if [ "$answer" == "y" ]; then else echo "cancel" fi - diff --git a/tips/backup.md b/tips/backup.md index 79fb4e6..70e72d1 100644 --- a/tips/backup.md +++ b/tips/backup.md @@ -13,29 +13,29 @@ 1. 準備の2で用意したメディアからブートする 2. バックアップするディスクの容量を縮める。(使用領域+2,3Gバイト程度に縮める) - - GPartedを起動して、バックアップするドライブ(ここではsdb)を開く - - ![gparted1](./pic/backup01.png) - - 使用済みの領域15G程度なので、17Gちょっとまで縮める - - ![gparted2](./pic/backup02.png) + - GPartedを起動して、バックアップするドライブ(ここではsdb)を開く + - ![gparted1](./pic/backup01.png) + - 使用済みの領域15G程度なので、17Gちょっとまで縮める + - ![gparted2](./pic/backup02.png) 3. 使用しているブロックサイズを確認する - - ターミナルを開いて、コマンドを叩くsudo fdisk -l /dev/sdb - -```shell -hyt@usbuntu:~$ sudo fdisk -l /dev/sdb -[sudo] hyt のパスワード: -ディスク /dev/sdb: 59.6 GiB, 64023257088 バイト, 125045424 セクタ -単位: セクタ (1 * 512 = 512 バイト) -セクタサイズ (論理 / 物理): 512 バイト / 512 バイト -I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト -ディスクラベルのタイプ: dos -ディスク識別子: 0x0002f2a2 - -デバイス 起動 開始位置 最後から セクタ サイズ Id タイプ -/dev/sdb1 2048 98303 96256 47M b W95 FAT32 -/dev/sdb2 * 98304 37083135 36984832 17.7G 83 Linux -``` -4. 縮めたパーティションのブロック+1までバックアップする + - ターミナルを開いて、コマンドを叩くsudo fdisk -l /dev/sdb + + ```shell + hyt@usbuntu:~$ sudo fdisk -l /dev/sdb + [sudo] hyt のパスワード: + ディスク /dev/sdb: 59.6 GiB, 64023257088 バイト, 125045424 セクタ + 単位: セクタ (1 * 512 = 512 バイト) + セクタサイズ (論理 / 物理): 512 バイト / 512 バイト + I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト + ディスクラベルのタイプ: dos + ディスク識別子: 0x0002f2a2 -- この例では、コマンドを叩いてsdb2のブロックの終わりが37083135なので37083136までバックアップする -- sudo dd if=/dev/sdb of=usbubuntu.img bs=512 count=37083136 + デバイス 起動 開始位置 最後から セクタ サイズ Id タイプ + /dev/sdb1 2048 98303 96256 47M b W95 FAT32 + /dev/sdb2 * 98304 37083135 36984832 17.7G 83 Linux + ``` + +4. 縮めたパーティションのブロック+1までバックアップする + - この例では、コマンドを叩いてsdb2のブロックの終わりが37083135なので37083136までバックアップする + - sudo dd if=/dev/sdb of=usbubuntu.img bs=512 count=37083136 From 8f0bf97f891fa45820e76a6ef43876077196eadf Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sun, 29 Dec 2024 22:17:21 +0900 Subject: [PATCH 3/9] fix: lint Signed-off-by: Hayato Mizushima --- ansible/mac.yml | 1 - ansible/roles/browser/tasks/main.yml | 2 +- ansible/roles/desktop/tasks/main.yml | 31 +++++++++++++--------- ansible/roles/desktop/tasks/multimedia.yml | 1 - ansible/roles/dev_desktop/tasks/docker.yml | 7 +++-- ansible/roles/dev_desktop/tasks/main.yml | 1 - ansible/roles/dev_desktop/tasks/vscode.yml | 5 ++-- ansible/roles/development/tasks/rust.yml | 3 +-- ansible/roles/japanese/tasks/main.yml | 12 ++++----- ansible/roles/remote/tasks/main.yml | 1 - ansible/roles/remote/tasks/ssh-server.yml | 17 ++++++------ ansible/roles/system/tasks/main.yml | 1 - ansible/roles/wsl/tasks/main.yml | 1 - ansible/ubuntu.yml | 3 +-- 14 files changed, 40 insertions(+), 46 deletions(-) diff --git a/ansible/mac.yml b/ansible/mac.yml index 8298340..54fbf83 100644 --- a/ansible/mac.yml +++ b/ansible/mac.yml @@ -1,4 +1,3 @@ ---- - name: setup local machine hosts: localhost connection: local diff --git a/ansible/roles/browser/tasks/main.yml b/ansible/roles/browser/tasks/main.yml index 68b4885..9765521 100644 --- a/ansible/roles/browser/tasks/main.yml +++ b/ansible/roles/browser/tasks/main.yml @@ -6,7 +6,7 @@ dest: /usr/share/keyrings/brave-browser-archive-keyring.gpg - ansible.builtin.apt_repository: - repo: "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" + repo: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main state: present - name: install brave using apt diff --git a/ansible/roles/desktop/tasks/main.yml b/ansible/roles/desktop/tasks/main.yml index 60cf3f4..caefc27 100644 --- a/ansible/roles/desktop/tasks/main.yml +++ b/ansible/roles/desktop/tasks/main.yml @@ -1,4 +1,3 @@ ---- - name: install desktop tools using apt become: true ansible.builtin.apt: @@ -8,7 +7,7 @@ - exfatprogs - gparted - hardinfo - - "linux-generic-hwe-{{ ansible_facts['distribution_version'] }}" + - linux-generic-hwe-{{ ansible_facts['distribution_version'] }} - meld - thunderbird-locale-ja - winbind @@ -29,33 +28,39 @@ - name: set cinnamon env default terminal community.general.dconf: - key: "/org/cinnamon/desktop/applications/terminal/exec" - value: "'terminator'" + key: /org/cinnamon/desktop/applications/terminal/exec + value: terminator state: present - name: set cinnamon env key customize (1/2) community.general.dconf: - key: "/org/cinnamon/desktop/wm/preferences/mouse-button-modifier" - value: "''" + key: /org/cinnamon/desktop/wm/preferences/mouse-button-modifier + value: state: present - name: set cinnamon env key customize (2/2) community.general.dconf: - key: "/org/cinnamon/desktop/wm/preferences/mouse-button-zoom-modifier" - value: "''" + key: /org/cinnamon/desktop/wm/preferences/mouse-button-zoom-modifier + value: state: present - name: set start menu favorite community.general.dconf: - key: "/org/cinnamon/favorite-apps" - value: "['firefox.desktop', 'cinnamon-settings.desktop', 'nemo.desktop', 'terminator.desktop']" + key: /org/cinnamon/favorite-apps + value: + [ + firefox.desktop, + cinnamon-settings.desktop, + nemo.desktop, + terminator.desktop, + ] state: present - name: disable sleep when close note pc display become: true ansible.builtin.lineinfile: path: /etc/systemd/logind.conf - line: "HandleLidSwitch=ignore" + line: HandleLidSwitch=ignore insertafter: EOF - name: set clock local for Windows dual boot system @@ -80,8 +85,8 @@ - name: add chrome apt repository become: true ansible.builtin.apt_repository: - repo: "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" - filename: "google-chrome" + repo: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main + filename: google-chrome state: present - name: install google-chrome diff --git a/ansible/roles/desktop/tasks/multimedia.yml b/ansible/roles/desktop/tasks/multimedia.yml index 6eac61c..2d353a1 100644 --- a/ansible/roles/desktop/tasks/multimedia.yml +++ b/ansible/roles/desktop/tasks/multimedia.yml @@ -1,4 +1,3 @@ ---- - name: install multimedia applications using apt become: true ansible.builtin.apt: diff --git a/ansible/roles/dev_desktop/tasks/docker.yml b/ansible/roles/dev_desktop/tasks/docker.yml index 5c1cae9..6e754e8 100644 --- a/ansible/roles/dev_desktop/tasks/docker.yml +++ b/ansible/roles/dev_desktop/tasks/docker.yml @@ -1,4 +1,3 @@ ---- - name: install docker build dependencies become: true ansible.builtin.apt: @@ -13,13 +12,13 @@ - name: add docker apt key become: true ansible.builtin.apt_key: - url: "https://download.docker.com/linux/ubuntu/gpg" + url: https://download.docker.com/linux/ubuntu/gpg state: present - name: add docker repository become: true ansible.builtin.apt_repository: - repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_facts['distribution_release'] }} stable" + repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_facts['distribution_release'] }} stable - name: install docker become: true @@ -36,4 +35,4 @@ ansible.builtin.user: name: "{{ ansible_facts['user_id'] }}" groups: docker - append: yes + append: true diff --git a/ansible/roles/dev_desktop/tasks/main.yml b/ansible/roles/dev_desktop/tasks/main.yml index 9925179..d181c63 100644 --- a/ansible/roles/dev_desktop/tasks/main.yml +++ b/ansible/roles/dev_desktop/tasks/main.yml @@ -1,3 +1,2 @@ ---- - import_tasks: vscode.yml # - import_tasks: docker.yml diff --git a/ansible/roles/dev_desktop/tasks/vscode.yml b/ansible/roles/dev_desktop/tasks/vscode.yml index 83572e0..0fccb88 100644 --- a/ansible/roles/dev_desktop/tasks/vscode.yml +++ b/ansible/roles/dev_desktop/tasks/vscode.yml @@ -1,14 +1,13 @@ ---- - name: add vscode key become: true ansible.builtin.apt_key: - url: "https://packages.microsoft.com/keys/microsoft.asc" + url: https://packages.microsoft.com/keys/microsoft.asc state: present - name: add VS Code repo become: true ansible.builtin.apt_repository: - repo: "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" + repo: deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main filename: vscode state: present diff --git a/ansible/roles/development/tasks/rust.yml b/ansible/roles/development/tasks/rust.yml index 9a13f21..5b9c19b 100644 --- a/ansible/roles/development/tasks/rust.yml +++ b/ansible/roles/development/tasks/rust.yml @@ -1,8 +1,7 @@ ---- - name: check if cargo is installed ansible.builtin.shell: command -v cargo register: cargo_exists - ignore_errors: yes + ignore_errors: true - name: Download Installer when: cargo_exists is failed diff --git a/ansible/roles/japanese/tasks/main.yml b/ansible/roles/japanese/tasks/main.yml index f2cfe01..7407f64 100644 --- a/ansible/roles/japanese/tasks/main.yml +++ b/ansible/roles/japanese/tasks/main.yml @@ -3,28 +3,28 @@ ansible.builtin.apt_key: url: https://www.ubuntulinux.jp/ubuntu-jp-ppa-keyring.gpg state: present - when: "ansible_facts['distribution_release'] == 'jammy'" + when: ansible_facts['distribution_release'] == 'jammy' - name: Add Ubuntu Japanese archive keyring become: true ansible.builtin.apt_key: url: https://www.ubuntulinux.jp/ubuntu-ja-archive-keyring.gpg state: present - when: "ansible_facts['distribution_release'] == 'jammy'" + when: ansible_facts['distribution_release'] == 'jammy' - name: Download Ubuntu Japanese repository become: true ansible.builtin.get_url: - url: "https://www.ubuntulinux.jp/sources.list.d/jammy.list" + url: https://www.ubuntulinux.jp/sources.list.d/jammy.list dest: /etc/apt/sources.list.d/ubuntu-ja.list - when: "ansible_facts['distribution_release'] == 'jammy'" + when: ansible_facts['distribution_release'] == 'jammy' - name: Download Ubuntu Japanese repository become: true ansible.builtin.get_url: - url: "https://www.ubuntulinux.jp/sources.list.d/noble.sources" + url: https://www.ubuntulinux.jp/sources.list.d/noble.sources dest: /etc/apt/sources.list.d/ubuntu-ja.sources - when: "ansible_facts['distribution_release'] == 'noble'" + when: ansible_facts['distribution_release'] == 'noble' - name: install ja package become: true diff --git a/ansible/roles/remote/tasks/main.yml b/ansible/roles/remote/tasks/main.yml index 77927f9..b63e4c6 100644 --- a/ansible/roles/remote/tasks/main.yml +++ b/ansible/roles/remote/tasks/main.yml @@ -1,4 +1,3 @@ ---- - name: download chrome-remote-desktop deb ansible.builtin.get_url: # CRD 125 seems not working https://askubuntu.com/questions/1512423/chrome-remote-desktop-in-24-04 diff --git a/ansible/roles/remote/tasks/ssh-server.yml b/ansible/roles/remote/tasks/ssh-server.yml index ca3d843..faeadaf 100644 --- a/ansible/roles/remote/tasks/ssh-server.yml +++ b/ansible/roles/remote/tasks/ssh-server.yml @@ -1,4 +1,3 @@ ---- - name: install openssh-server become: true ansible.builtin.apt: @@ -20,26 +19,26 @@ become: true ansible.builtin.replace: path: /etc/ssh/sshd_config - regexp: "^#Port 22" - replace: "Port {{ lookup('env', 'ssh_port') }}" + regexp: ^#Port 22 + replace: Port {{ lookup('env', 'ssh_port') }} - name: update ssh settings (4/6) become: true ansible.builtin.replace: path: /etc/ssh/sshd_config - regexp: "^#AuthorizedKeysFile" - replace: "AuthorizedKeysFile" + regexp: ^#AuthorizedKeysFile + replace: AuthorizedKeysFile - name: update ssh settings (5/6) become: true ansible.builtin.replace: path: /etc/ssh/sshd_config - regexp: "^#PasswordAuthentication yes" - replace: "PasswordAuthentication no" + regexp: ^#PasswordAuthentication yes + replace: PasswordAuthentication no - name: update ssh settings (6/6) become: true ansible.builtin.replace: path: /etc/ssh/sshd_config - regexp: "PermitRootLogin prohibit-password" - replace: "PermitRootLogin no" + regexp: PermitRootLogin prohibit-password + replace: PermitRootLogin no diff --git a/ansible/roles/system/tasks/main.yml b/ansible/roles/system/tasks/main.yml index 2e92aef..e2e2dca 100644 --- a/ansible/roles/system/tasks/main.yml +++ b/ansible/roles/system/tasks/main.yml @@ -1,4 +1,3 @@ ---- - name: use English folder name ansible.builtin.shell: LANG=C xdg-user-dirs-update --force diff --git a/ansible/roles/wsl/tasks/main.yml b/ansible/roles/wsl/tasks/main.yml index 318a7fc..0205714 100644 --- a/ansible/roles/wsl/tasks/main.yml +++ b/ansible/roles/wsl/tasks/main.yml @@ -1,4 +1,3 @@ ---- - name: copy font conf become: true ansible.builtin.copy: diff --git a/ansible/ubuntu.yml b/ansible/ubuntu.yml index 1e50f8c..3a0085c 100644 --- a/ansible/ubuntu.yml +++ b/ansible/ubuntu.yml @@ -1,4 +1,3 @@ ---- - name: setup local machine hosts: localhost connection: local @@ -9,7 +8,7 @@ - name: prompt_dev prompt: Is target environment for development? [y/N] private: false - default: "y" + default: y - name: prompt_remote prompt: Set up remote tools? [y/N] private: false From 4c238dbad49b5a97c13099d405e01f71af3f1328 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sun, 29 Dec 2024 22:20:23 +0900 Subject: [PATCH 4/9] fix: actions Signed-off-by: Hayato Mizushima --- .github/workflows/spell-check.yaml | 14 ++++++ .github/workflows/test-db.yaml | 75 ------------------------------ 2 files changed, 14 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/spell-check.yaml delete mode 100644 .github/workflows/test-db.yaml diff --git a/.github/workflows/spell-check.yaml b/.github/workflows/spell-check.yaml new file mode 100644 index 0000000..84b60db --- /dev/null +++ b/.github/workflows/spell-check.yaml @@ -0,0 +1,14 @@ +name: spell-check + +on: + pull_request: + workflow_dispatch: + +jobs: + spell-check: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run spell-check + uses: streetsidesoftware/cspell-action@v6 diff --git a/.github/workflows/test-db.yaml b/.github/workflows/test-db.yaml deleted file mode 100644 index 8f475ec..0000000 --- a/.github/workflows/test-db.yaml +++ /dev/null @@ -1,75 +0,0 @@ -name: test-db - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - test-db: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Docker Compose - run: | - sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - - - name: Start services with Docker Compose - run: docker-compose -f projects/artdb/compose.yaml up -d - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install uv - run: | - curl -LsSf https://astral.sh/uv/install.sh | sh - uv python install 3.12 - - - name: Generate token - id: generate-token - uses: tibdex/github-app-token@v2 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.PRIVATE_KEY }} - - - name: Set git config - uses: autowarefoundation/autoware-github-actions/set-git-config@v1 - with: - token: ${{ steps.generate-token.outputs.token }} - - - name: Install dependencies with uv - run: | - uv tool install . - - - name: Install mise to load .env file - run: | - curl https://mise.run | sh - echo 'eval "$(/home/runner/.local/bin/mise activate bash)"' >> /home/runner/.bashrc - - - name: Run database migrations - run: | - source ~/.bashrc - eval "$(mise env)" - uv run alembic upgrade head - working-directory: projects/artdb - - - name: Run model tests - run: | - uv run pytest projects/artdb/test/models - - - name: Run DB integration tests - run: | - uv run pytest projects/artdb/test/integration - - - name: Run API tests - run: | - uv run pytest projects/artapi/test/ From 8631826daa7135bfa68710e75062e562a894b659 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Mon, 30 Dec 2024 23:40:59 +0900 Subject: [PATCH 5/9] chore: update Signed-off-by: Hayato Mizushima --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a6a824..e5c95cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.42.0 + rev: v0.43.0 hooks: - id: markdownlint args: [-c, .markdownlint.yaml, --fix] @@ -39,13 +39,13 @@ repos: - id: shellcheck - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.9.0-1 + rev: v3.10.0-2 hooks: - id: shfmt args: [-w, -s, -i=4] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.0 # Match the version used by the vscode extension. Otherwise, the editor and the command may say different things. + rev: v0.8.0 # Match the version used by the vscode extension. Otherwise, the editor and the command may say different things. hooks: - id: ruff args: [--fix] From 4053c9af4da8f380e0439968964e0154a049e5cd Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 02:49:36 +0900 Subject: [PATCH 6/9] feat: add dict Signed-off-by: Hayato Mizushima --- .cspell.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .cspell.json diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..f7d9f8b --- /dev/null +++ b/.cspell.json @@ -0,0 +1,44 @@ +{ + "words": [ + "appdir", + "argcomplete", + "blockinfile", + "ccache", + "containerd", + "customizer", + "cyclonedds", + "dconf", + "dotenvx", + "fcitx", + "flameshot", + "gparted", + "hwclock", + "insertafter", + "jorgebucaran", + "keeweb", + "keymap", + "kolourpaint", + "libxcb", + "lichtblick", + "lineinfile", + "logind", + "mozc", + "ncdu", + "nemo", + "nsswitch", + "orbstack", + "pipx", + "pytest", + "rerunfailures", + "rustup", + "shellenv", + "sqlitebrowser", + "usbubuntu", + "usbuntu", + "vcstool", + "venv", + "winbind", + "XMODIFIERS", + "zstd", + ] +} From 89966827d6b82d9d14e49f14e70df186a413fe78 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 02:53:18 +0900 Subject: [PATCH 7/9] feat: update dict Signed-off-by: Hayato Mizushima --- .cspell.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index f7d9f8b..756db3e 100644 --- a/.cspell.json +++ b/.cspell.json @@ -2,25 +2,36 @@ "words": [ "appdir", "argcomplete", + "bierner", "blockinfile", + "bpruitt", "ccache", + "charliermarsh", "containerd", "customizer", "cyclonedds", + "danielrichter", "dconf", "dotenvx", + "exfatprogs", "fcitx", + "fdisk", "flameshot", "gparted", + "hardinfo", "hwclock", "insertafter", + "isort", "jorgebucaran", "keeweb", "keymap", + "keyrings", "kolourpaint", + "libfuse", "libxcb", "lichtblick", "lineinfile", + "localectl", "logind", "mozc", "ncdu", @@ -31,7 +42,10 @@ "pytest", "rerunfailures", "rustup", + "shellcheck", "shellenv", + "shfmt", + "SHLVL", "sqlitebrowser", "usbubuntu", "usbuntu", @@ -39,6 +53,7 @@ "venv", "winbind", "XMODIFIERS", - "zstd", + "xset", + "zstd" ] } From ca6b241b6096f7955f5886671356aad089289975 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 02:54:44 +0900 Subject: [PATCH 8/9] fix: dict Signed-off-by: Hayato Mizushima --- .cspell.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.cspell.json b/.cspell.json index 756db3e..ddcc32b 100644 --- a/.cspell.json +++ b/.cspell.json @@ -1,5 +1,6 @@ { "words": [ + "amannn", "appdir", "argcomplete", "bierner", From a779369278899f53d0d5e62875eb103d4b7c8a9b Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 03:13:24 +0900 Subject: [PATCH 9/9] fix: pre-commit Signed-off-by: Hayato Mizushima --- .shellcheckrc | 1 + post_setup.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..f4bd9e6 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +disable=SC1071 diff --git a/post_setup.sh b/post_setup.sh index 9f05a9f..d39324b 100755 --- a/post_setup.sh +++ b/post_setup.sh @@ -1,13 +1,13 @@ #!/bin/bash if [ -f "$HOME/.ssh/github_rsa" ]; then - bash $HOME/.dotfiles/install.sh + bash "$HOME/.dotfiles/install.sh" mise install -y else echo "$HOME/.ssh/github_rsa not found" fi -read -p "Do you want install python cli tools using uv? (y/n): " answer +read -p -r "Do you want install python cli tools using uv? (y/n): " answer if [ "$answer" == "y" ]; then uv tool install pre-commit