mirror of
https://github.com/MuntashirAkon/android-debloat-list.git
synced 2025-07-02 06:08:08 +08:00
227 lines
9.0 KiB
PHP
227 lines
9.0 KiB
PHP
<?php
|
|
/* SPDX-License-Identifier: AGPL-3.0-or-later */
|
|
|
|
const SUPPORTED_REMOVAL_TYPES = ['delete', 'replace', 'caution', 'unsafe'];
|
|
const SUPPORTED_TAGS = [];
|
|
const SUPPRESS_LINT_CONST_LABEL_SAME_AS_ID = 'LabelSameAsId';
|
|
const SUPPRESS_LINT_CONSTS = [SUPPRESS_LINT_CONST_LABEL_SAME_AS_ID];
|
|
const REPO_DIR = __DIR__ . "/..";
|
|
const SUGGESTIONS_DIR = REPO_DIR . '/suggestions';
|
|
const LINT_DIR = __DIR__ . "/../build";
|
|
|
|
if (!file_exists(LINT_DIR)) {
|
|
mkdir(LINT_DIR, 0777, true);
|
|
}
|
|
|
|
$lint_writer = fopen(LINT_DIR . "/lint-results.txt", "w");
|
|
|
|
// START MAIN
|
|
|
|
$error_count = 0;
|
|
foreach (scandir(REPO_DIR) as $filename) {
|
|
if (!str_ends_with($filename, ".json")) {
|
|
continue;
|
|
}
|
|
$file = REPO_DIR . '/' . $filename;
|
|
$type = substr($filename, 0, -5);
|
|
try {
|
|
$list = json_decode( |