diff --git a/.envrc b/.envrc index e52db4af..197c0d59 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,3 @@ #!/bin/bash -nix_direnv_watch_file .ruby-version use flake diff --git a/renovate.json b/.github/renovate.json similarity index 100% rename from renovate.json rename to .github/renovate.json diff --git a/.github/workflows/ci-nix.yml b/.github/workflows/ci-nix.yml index a7b95156..d7341a42 100644 --- a/.github/workflows/ci-nix.yml +++ b/.github/workflows/ci-nix.yml @@ -6,15 +6,11 @@ on: - '.github/workflows/ci-nix.yml' - '**.nix' - 'flake.*' - - '.ruby-version' - - 'dprint.json' pull_request: paths: - '.github/workflows/ci-nix.yml' - '**.nix' - 'flake.*' - - '.ruby-version' - - 'dprint.json' schedule: # Every 10:42 JST # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule @@ -34,7 +30,7 @@ jobs: - run: nix run .#console - run: nix develop --command bundle install - name: Log current versions - run: nix develop --command bundle exec rake inspect_dependencies + run: nix develop --command bundle exec rake deps - name: Test with external dependencies run: nix develop --command bundle exec rake check_non_ruby - name: Test with Ruby diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 279e5373..59f28dad 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,13 +26,19 @@ jobs: - uses: actions/checkout@v3 - uses: dprint/check@v2.2 with: - # Keep same version as *.nix - dprint-version: '0.36.1' + # Keep same version as used in *.nix + dprint-version: '0.40.2' typos: timeout-minutes: 15 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # Keep same version as *.nix - - uses: crate-ci/typos@v1.14.10 + # Keep same version as used in *.nix + - uses: crate-ci/typos@v1.16.8 + with: + # https://github.com/crate-ci/typos/issues/779 + files: | + . + .github + .vscode diff --git a/.vscode/extensions.json b/.vscode/extensions.json index edc11f54..280fae58 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,6 @@ "editorconfig.editorconfig", "github.vscode-github-actions", "tekumara.typos-vscode", - "koichisasada.vscode-rdbg", "soutaro.steep-vscode", "soutaro.rbs-syntax", "dprint.dprint", diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 40aada76..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "rdbg", - "name": "Debug current file with rdbg", - "request": "launch", - "script": "${file}", - "args": [], - "askParameters": true - }, - { - "type": "rdbg", - "name": "Attach with rdbg", - "request": "attach" - }, - { - "type": "rdbg", - "name": "Run rake test", - "request": "launch", - "command": "rake", - "script": "test", - "args": [], - "askParameters": false - } - ] -} diff --git a/Rakefile b/Rakefile index b250c880..80af573a 100644 --- a/Rakefile +++ b/Rakefile @@ -130,7 +130,7 @@ task(:update) do end desc 'Print dependencies' -task :inspect_dependencies do +task :deps do sh('ruby --version') sh('dprint --version') sh('tree --version') @@ -141,7 +141,7 @@ end desc 'Tests except ruby' task :check_non_ruby do Rake::Task['dprint'].invoke - sh('typos') + sh('typos . .github .vscode') sh('actionlint') sh('nixpkgs-fmt --check ./*.nix') end diff --git a/_typos.toml b/_typos.toml deleted file mode 100644 index 99ec3ada..00000000 --- a/_typos.toml +++ /dev/null @@ -1,3 +0,0 @@ -[files] -ignore-hidden = false -extend-exclude = [".git", '.direnv', '.yardoc', '.bundle'] diff --git a/dprint.json b/dprint.json index 2d660774..cf2f6c5a 100644 --- a/dprint.json +++ b/dprint.json @@ -7,7 +7,6 @@ "printWidth": 120, "singleQuote": true }, - "includes": ["**/*.{json,md,yml,html,css}"], "excludes": [ ".git", "**/*lock.json", @@ -18,7 +17,7 @@ ], "plugins": [ "https://plugins.dprint.dev/json-0.17.4.wasm", - "https://plugins.dprint.dev/markdown-0.15.3.wasm", - "https://plugins.dprint.dev/prettier-0.26.6.json@0118376786f37496e41bb19dbcfd1e7214e2dc859a55035c5e54d1107b4c9c57" + "https://plugins.dprint.dev/markdown-0.16.0.wasm", + "https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe" ] } diff --git a/flake.lock b/flake.lock index 70c3c237..bc6fc0a7 100644 --- a/flake.lock +++ b/flake.lock @@ -1,49 +1,15 @@ { "nodes": { - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" }, "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "lastModified": 1692799911, + "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", "owner": "numtide", "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", "type": "github" }, "original": { @@ -54,47 +20,24 @@ }, "nixpkgs": { "locked": { - "lastModified": 1690726002, - "narHash": "sha256-cACz6jCJZtsZHGCJAN4vMobxzH5s6FCOTZHMrh/Hu0M=", + "lastModified": 1693377291, + "narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "391e8db1f06c3f74c2d313a73135515023af3993", + "rev": "e7f38be3775bab9659575f192ece011c033655f0", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-ruby": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1690614109, - "narHash": "sha256-iSuFvbxyJCa3yzW0wEKiStvuwdWYOUwzCmHoInef26w=", - "owner": "bobvanderlinden", - "repo": "nixpkgs-ruby", - "rev": "509892e8018ca45f84bbe2650f2bcebc42c4c593", - "type": "github" - }, - "original": { - "owner": "bobvanderlinden", - "repo": "nixpkgs-ruby", - "type": "github" - } - }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "nixpkgs-ruby": "nixpkgs-ruby" + "nixpkgs": "nixpkgs" } }, "systems": { @@ -111,21 +54,6 @@ "repo": "default", "type": "github" } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7c3d3b05..b0e80700 100644 --- a/flake.nix +++ b/flake.nix @@ -1,25 +1,27 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; - nixpkgs-ruby.url = "github:bobvanderlinden/nixpkgs-ruby"; - nixpkgs-ruby.inputs.nixpkgs.follows = "nixpkgs"; + # Candidate channels + # - https://github.com/kachick/anylang-template/issues/17 + # - https://discourse.nixos.org/t/differences-between-nix-channels/13998 + # How to update the revision + # - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, nixpkgs-ruby, flake-utils }: + outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; - ruby = nixpkgs-ruby.lib.packageFromRubyVersionFile { - file = ./.ruby-version; - inherit system; - }; in rec { devShells.default = with pkgs; mkShell { buildInputs = [ - ruby + # https://github.com/NixOS/nix/issues/730#issuecomment-162323824 + bashInteractive + + ruby_3_2 dprint tree nil @@ -42,10 +44,10 @@ cp -rf ./lib $out install -t $out/bin bin/pure-console.rb makeWrapper $out/bin/pure-console.rb $out/bin/console \ - --prefix PATH : ${nixpkgs.lib.makeBinPath [ ruby ]} + --prefix PATH : ${nixpkgs.lib.makeBinPath [ pkgs.ruby ]} ''; runtimeDependencies = [ - ruby + pkgs.ruby ]; };