CSScomb

CSS coding style formatter.

Version

v4.2.0

Runtime

Node.js v10.15.3 npm 6.4.1

Supported Languages

CSS

Official Documentation

http://csscomb.com/

YAML Configuration

csscomb:

  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:

    true/false

  • config-file:

    Alias of --config option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.25 CPU with 960 MiB RAM.

  • options:

    Below is the list of options that are supported:

    -c, --config [path]
          Path to configuration file.
    
  • thresholds:

    • num-issues:

      No tool specific severity levels are available.

  • experimental:

    • incremental:

      true/false

      Note: The incremental analysis is disabled if any kinds of configuration files are changed. The files recognized as configuration files are as follows:

      • Configuration files:
        • Files specified in config-file field
        • Files specified to -c, --config options
        • If none of the above configuration files are found:
          • **/.csscomb.json

YAML Examples

  • With default options:

    inspecode:
      csscomb: default
    
  • With enabling auto-fixing and default options:

    inspecode:
      csscomb: auto-fix
    
  • With custom machine:

    inspecode:
      csscomb:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
    
  • With a configuration file:

    inspecode:
      csscomb:
        config-file: ./my-csscomb.json
    

    The above configuration is equivalent to:

    inspecode:
      csscomb:
        options:
          --config: ./my-csscomb.json
    

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode first lets CSScomb to find configuration files in your repository. See https://github.com/csscomb/csscomb.js/blob/v4.2.0/doc/configuration.md#where-to-put-config about how CSScomb looks for configuration files.

In addition, if CSScomb cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named .csscomb.json and specifies the file first found to CSScomb 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:
  csscomb:
    config-file: ""

Multiple Projects In Single Repository

Inspecode automatically detects Node.js projcects (package.json files) in your repository, and then runs CSScomb for each project. In addition, Inspecode also runs CSScomb at the root of your repository with excluding project directories, so that any CSS files, which are not a part of Node.js projects, can also be checked by CSScomb.

Note: As of now, Inspecode uses the same configuration when running CSScomb every time regardless of where it runs on in a job. So if this does not suit you and you want to run CSScomb with different configuration on each Node.js project, use default built-in configuration and place CSScomb configuration files, such as .csscomb.json, at locations where CSScomb can recognize automatically.

results matching ""

    No results matching ""