Tailor

Tailor is a cross-platform static analysis and lint tool for source code written in Apple's Swift programming language. It analyzes your code to ensure consistent styling and help avoid bugs.

Version

0.12.0

Runtime

OpenJDK 8

Supported Languages

Swift

Official Documentation

https://tailor.sh/

YAML Configuration

tailor:

  • input:

    Patterns to include in reports.

    Note: The input patterns are not applied when running Tailor therefore the files excluded by the patterns are always processed and you may even see logs related to the excluded files in the job console, but Inspecode eventually ignores any issues detected on the excluded files when generating job reports.

    If you need to let Tailor ignore particular files, consider specifying -c, --config under options: instead.

  • ignore:

    Patterns to exclude from reports.

    Note: The ignore patterns are not applied when running Tailor as same as input:.

  • auto-fix:

    N/A

  • config-file:

    Alias of --config option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.5 CPU with 1920 MiB RAM.

      Inspecode configures the maximum heap size (-Xmx) of the Java virtual machine (JVM) through JAVA_OPTS environment variable according to this value. Inspecode reserves 240 MiB RAM for system, and makes the rest of RAM available to JVM for heap allocation. For example, -Xmx=1680m is specified by default (for 0.5 CPU), -Xmx=5520m is exported for 1.5 CPU.

  • options:

    Below is the list of options that are supported:

    -c,--config=<path/to/.tailor.yml>             specify configuration file
       --except=<rule1,rule2,...>                 run all rules except the specified ones
    -l,--max-line-length=<0-999>                  maximum Line length (in characters)
       --max-class-length=<0-999>                 maximum Class length (in lines)
       --max-closure-length=<0-999>               maximum Closure length (in lines)
       --max-file-length=<0-999>                  maximum File length (in lines)
       --max-function-length=<0-999>              maximum Function length (in lines)
       --max-name-length=<0-999>                  maximum Identifier name length (in characters)
       --max-severity=<error|warning (default)>   maximum severity
       --max-struct-length=<0-999>                maximum Struct length (in lines)
       --min-name-length=<1-999>                  minimum Identifier name length (in characters)
       --only=<rule1,rule2,...>                   run only the specified rules
       --purge=<1-999>                            reduce memory usage by clearing DFA cache after
                                                  specified number of files are parsed

YAML Examples

  • With default options:

    inspecode:
      tailor: default
  • With custom machine:

    inspecode:
      tailor:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

    inspecode:
      tailor:
        options:
          -l: 120
          --max-function-length: 100
  • With a configuration file:

    inspecode:
      tailor:
        config-file: maytailor.yml

    The above configuration is equivalent to:

    inspecode:
      tailor:
        options:
          --config: maytailor.yml

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode first lets Tailor to find configuration files in your repository. See https://github.com/sleekbyte/tailor#configuration about how Tailor looks for configuration files.

In addition, if Tailor cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named .tailor.yml or tailor.yml and specifies the file first found to Tailor automatically via --config option.

Note: Inspecode ignores specific configuration files while searching. See Configuration > Tool Configuration > Field: config-file for detail.

If the configuration file detected by Inspecode is not the one you want to use or you do not want to use any configuration files, you can disable Inspecode from detecting configuration files by explicitly setting an empty string to config-file field like below:

inspecode:
  tailor:
    config-file: ""

results matching ""

    No results matching ""