peripheryapp / periphery

A tool to identify unused code in Swift projects.
MIT License
5.2k stars 186 forks source link

Unknown option '--auto-remove' #808

Closed sjavora closed 2 weeks ago

sjavora commented 1 month ago

Is this not available in 3.0 beta?

periphery scan --auto-remove
error: Unknown option '--auto-remove'
Usage: periphery scan [<options>] [<build-arguments> ...]
  See 'periphery scan --help' for more information.

yet the help command does list the option...

OVERVIEW: Scan for unused code

USAGE: periphery scan [<options>] [<build-arguments> ...]

ARGUMENTS:
  <build-arguments>       Arguments following '--' will be passed to the underlying build tool, which is either 'swift build' or 'xcodebuild' depending on your project

OPTIONS:
  --setup                 Enable guided setup
  --config <config>       Path to configuration file. By default Periphery will look for .periphery.yml in the current directory
  --workspace <workspace> Path to your project's .xcworkspace. Xcode projects only
  --project <project>     Path to your project's .xcodeproj - supply this option if your project doesn't have an .xcworkspace. Xcode projects only
  --file-targets-path <file-targets-path>
                          File target mapping configuration file paths. For use with third-party build systems
  --schemes <schemes>     Schemes that must be built in order to produce the targets passed to the --targets option. Xcode projects only
  --targets <targets>     Target names to scan. Required for Xcode projects. Optional for Swift Package Manager projects, default behavior is to scan all targets defined in Package.swift
  --format <format>       Output format (allowed: xcode, csv, json, checkstyle, codeclimate, github-actions) (values: xcode, csv, json, checkstyle, codeclimate, github-actions; default: xcode)
  --index-exclude <index-exclude>
                          Source file globs to exclude from indexing. Declarations and references within these files will not be considered during analysis
  --report-exclude <report-exclude>
                          Source file globs to exclude from the results. Note that this option is purely cosmetic, these files will still be indexed
  --report-include <report-include>
                          Source file globs to include in the results. This option supersedes '--report-exclude'. Note that this option is purely cosmetic, these files will still be indexed
  --retain-files <retain-files>
                          Source file globs for which all containing declarations will be retained
  --index-store-path <index-store-path>
                          Index store paths. Implies '--skip-build'
  --retain-public         Retain all public declarations, recommended for framework/library projects
  --disable-redundant-public-analysis
                          Disable identification of redundant public accessibility
  --disable-unused-import-analysis
                          Disable identification of unused imports
  --retain-assign-only-properties
                          Retain properties that are assigned, but never used
  --retain-assign-only-property-types <retain-assign-only-property-types>
                          Property types to retain if the property is assigned, but never read
  --external-codable-protocols <external-codable-protocols>
                          Names of external protocols that inherit Codable. Properties and CodingKey enums of types conforming to these protocols will be retained
  --external-test-case-classes <external-test-case-classes>
                          Names of XCTestCase subclasses that reside in external targets
  --retain-objc-accessible
                          Retain declarations that are exposed to Objective-C implicitly by inheriting NSObject classes, or explicitly with the @objc and @objcMembers attributes
  --retain-objc-annotated Retain declarations that are exposed to Objective-C explicitly with the @objc and @objcMembers attributes
  --retain-unused-protocol-func-params
                          Retain unused protocol function parameters, even if the parameter is unused in all conforming functions
  --retain-swift-ui-previews
                          Retain SwiftUI previews
  --retain-codable-properties
                          Retain properties on Codable types (including Encodable and Decodable)
  --retain-encodable-properties
                          Retain properties on Encodable types only
  --auto-remove           Automatically remove code that can be done so safely without introducing build errors (experimental)
  --clean-build           Clean existing build artifacts before building
  --skip-build            Skip the project build step
  --skip-schemes-validation
                          Skip schemes validation
  --relative-results      Output result paths relative to the current directory
  --strict                Exit with non-zero status if any unused code is found
  --disable-update-check  Disable checking for updates
  --verbose               Enable verbose logging
  --quiet                 Only output results
  --json-package-manifest-path <json-package-manifest-path>
                          JSON package manifest path (obtained using `swift package describe --type json` or manually)
  --baseline <baseline>   Baseline file path used to filter results
  --write-baseline <write-baseline>
                          Baseline file path where results are written. Pass the same path to '--baseline' in subsequent scans to exclude the results recorded in the baseline.
  -h, --help              Show help information.
ileitch commented 2 weeks ago

Yes, the auto-remove feature has been removed in v3 because it had many issues, and I didn't have time to resolve them. I may reintroduce it when I have the time to reimplement it, possibly as a "pro" feature.