diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:26 +0900 |
| commit | 53f1fb395f33e0fb8db9aebd09ea9082f650f9f1 (patch) | |
| tree | f9e8bf0e9d4b1e98cce383574fb6a13b684fff08 /scripts/lint | |
| parent | 212f5cd75b1403ee75ffa44d7ebdb181174340c0 (diff) | |
| download | php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.gz php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.zst php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.zip | |
refactor: add linter
Diffstat (limited to 'scripts/lint')
| -rwxr-xr-x | scripts/lint | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 0000000..89f5fe0 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby + +require 'pathname' + +LINTERS = { + cargo_workspace_dependencies: [], + contiguous_use_block: [], + 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) |
