diff --git a/Taskfile.yml b/Taskfile.yml index 4ea2111..112411e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,45 +1,41 @@ +--- version: '3' -vars: - TARGET_DIRS: ./scripts - tasks: default: - deps: [all_for_ci, typo_check] + deps: [format, lint, test] - all_for_ci: - deps: [lint_node, lint_python] + format: + cmds: + - ruff format --respect-gitignore + - ruff check --fix + - pnpm format - lint_python: - deps: [ruff, yamllint] + lint: + deps: [lint_yaml] + cmds: + - ruff format --respect-gitignore --check + - ruff check --respect-gitignore + - pnpm lint - lint_node: - deps: [markdownlint, pyright] + lint_yaml: + cmds: + - >- + find . \( -name node_modules -o -name .venv \) \ + -prune -o -type f \( -name "*.yaml" -o -name "*.yml" \) -print \ + | xargs yamllint --no-warnings -c .yamllint.yml - - yamllint: + lint_shell: cmds: - >- find . \( -name node_modules -o -name .venv \) \ -prune -o -type f -name '*.yml' -print \ - | xargs yamllint --no-warnings -c ./.yamllint.yml + | xargs shellcheck - ruff: - cmds: - - ruff format --respect-gitignore --check - - ruff check --respect-gitignore - - pyright: - cmds: - - npx pyright - - markdownlint: - cmds: - - >- - find . -type d \( -name node_modules -o -name .venv \) \ - -prune -o -type f -name '*.md' -print \ - | xargs npx markdownlint --config ./.markdownlint.json - - typo_check: + lint_typos: cmds: - typos -V && typos + + test: + cmds: + - pnpm test diff --git a/package.json b/package.json index a010249..c2025b4 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,10 @@ { - "name": "sd-webui-enable-checker", - "type": "module", - "version": "2.6.3", - "description": "A simple extension for Automatic1111/stable-diffusion-webui", - "main": "index.js", - "scripts": { - "preinstall": "npx only-allow pnpm", - "test:biome": "biome check", - "format": "biome format --write", - "test:md": "npx markdownlint *.md", - "test": "run-s test:biome test:md" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/shirayu/sd-webui-enable-checker.git" - }, "author": "", - "license": "GNU AFFERO GENERAL PUBLIC LICENSE Version 3", - "bugs": { - "url": "https://github.com/shirayu/sd-webui-enable-checker/issues" - }, - "homepage": "https://github.com/shirayu/sd-webui-enable-checker", + "description": "", "devDependencies": { + "@taplo/cli": "^0.7.0", "@biomejs/biome": "1.9.4", + "markdown-it": "^14.1.0", "markdownlint-cli": "^0.44.0", "npm-run-all2": "^7.0.2", "pyright": "^1.1.394" @@ -30,5 +12,22 @@ "engines": { "npm": "Use pnpm instead of npm!" }, - "packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b" + "license": "", + "main": "", + "name": "sd-webui-enable-checker", + "scripts": { + "preinstall": "npx only-allow pnpm", + "format": "run-s format:biome format:markdownlint format:toml", + "format:biome": "biome check --write", + "format:markdownlint": "markdownlint -f ./*.md doc/*.md", + "format:toml": "taplo format *.toml", + "test": ":", + "lint": "run-s lint:biome lint:md lint:pyright lint:toml", + "lint:biome": "biome check", + "lint:md": "npx markdownlint *.md docs/*.md", + "lint:pyright": "pyright", + "lint:toml": "taplo format --check *.toml" + }, + "version": "1.0.0", + "packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 67f8048..7fb63e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,12 @@ importers: '@biomejs/biome': specifier: 1.9.4 version: 1.9.4 + '@taplo/cli': + specifier: ^0.7.0 + version: 0.7.0 + markdown-it: + specifier: ^14.1.0 + version: 14.1.0 markdownlint-cli: specifier: ^0.44.0 version: 0.44.0 @@ -84,6 +90,10 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@taplo/cli@0.7.0': + resolution: {integrity: sha512-Ck3zFhQhIhi02Hl6T4ZmJsXdnJE+wXcJz5f8klxd4keRYgenMnip3JDPMGDRLbnC/2iGd8P0sBIQqI3KxfVjBg==} + hasBin: true + '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} @@ -521,6 +531,8 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true + '@taplo/cli@0.7.0': {} + '@types/debug@4.1.12': dependencies: '@types/ms': 2.1.0 diff --git a/pyproject.toml b/pyproject.toml index a3fe3e1..4242a24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,10 +9,7 @@ license = { file = "LICENSE" } dependencies = [] [tool.uv] -dev-dependencies = [ - "ruff>=0.6.7", - "yamllint>=1.35.1", -] +dev-dependencies = ["ruff>=0.6.7", "yamllint>=1.35.1"] [tool.pyright] pythonVersion = "3.10"