aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/lint
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-28 17:45:06 +0900
committernsfisis <nsfisis@gmail.com>2026-06-28 17:45:26 +0900
commit53f1fb395f33e0fb8db9aebd09ea9082f650f9f1 (patch)
treef9e8bf0e9d4b1e98cce383574fb6a13b684fff08 /scripts/lint
parent212f5cd75b1403ee75ffa44d7ebdb181174340c0 (diff)
downloadphp-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.gz
php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.zst
php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.zip
refactor: add linter
Diffstat (limited to 'scripts/lint')
-rwxr-xr-xscripts/lint31
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)