Last active
June 4, 2024 05:42
-
-
Save eggplants/245a0a157c5a4e6e7bf2534eded79802 to your computer and use it in GitHub Desktop.
Write all errors once in disabled_rules in .swiftlint.yml / 既存プロジェクトにSwiftLintを導入するときに全てのエラーを一旦 .swiftlint.yml の disabled_rules に書く
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# In `Podfile`: | |
# ``` | |
# # Linter / Formatter | |
# pod 'SwiftLint' | |
# ``` | |
cat <<'A' > .swiftlint.yml | |
# Directory and file filters | |
excluded: | |
- Pods | |
# Enabled/disabled rules | |
analyzer_rules: | |
- unused_declaration | |
- unused_import | |
opt_in_rules: | |
- all | |
# TODO: ルールを有効化して修正する | |
disabled_rules: | |
A | |
./Pods/SwiftLint/swiftlint | | |
rev | | |
grep -oE '^)[^(]+' | cut -b2- | | |
rev | | |
sort | uniq -c | awk '$0=" - "$2" # "$1" violation(s)"' >> .swiftlint.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment