diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-21 08:08:15 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-21 08:08:45 +0900 |
| commit | c899a4675ca90507a420d901ef7fa26d8b285f23 (patch) | |
| tree | 405b8049c3ac59c65d56792c96f4a8c316bf605b /scripts/lint | |
| parent | 6b16a2cd672edcbfeaf7988591db92ed4c594ddc (diff) | |
| download | php-shirabe-c899a4675ca90507a420d901ef7fa26d8b285f23.tar.gz php-shirabe-c899a4675ca90507a420d901ef7fa26d8b285f23.tar.zst php-shirabe-c899a4675ca90507a420d901ef7fa26d8b285f23.zip | |
refactor(lint): rewrite structural linters from Ruby to PHP
Fold scripts/lint and scripts/linters/*.rb into a standalone Composer
project under scripts/linters/, matching the scripts/plugin-class-classifier/
convention. Uses no external packages, only PHP + Composer autoloading.
Verified byte-for-byte identical output against the original Ruby
implementation, both on the current repo (all linters pass) and on a
synthetic fixture exercising every violation type.
Entry point moves from `scripts/lint` to `scripts/linters/lint`.
Diffstat (limited to 'scripts/lint')
| -rwxr-xr-x | scripts/lint | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/scripts/lint b/scripts/lint deleted file mode 100755 index c9e33049..00000000 --- a/scripts/lint +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env ruby - -require 'pathname' - -LINTERS = { - cargo_workspace_dependencies: [], - contiguous_use_block: [], - no_banned_use: [], - no_decorative_section_comment: %w[ - crates/shirabe-semver/src/version_parser.rs - ], - no_format_trailing_comma: %w[ - crates/shirabe/src/package/loader/root_package_loader.rs - crates/shirabe-spdx-licenses/src/spdx_licenses.rs - ], - no_mod_rs: [], - no_std_collections_maps: [], - no_use_as_alias: [], - sorted_dependencies: [], -} - -root_dir = Pathname.new(__dir__).join('..').expand_path - -results = LINTERS.map do |linter, excludes| - require_relative "linters/#{linter}" - puts "===== #{linter} =====" - ok = send(linter, root_dir, excludes) - puts "Passed." if ok - puts - ok -end -exit(results.all? ? 0 : 1) |
