Green.Rules.Linting.PreferPipelines (green v0.2.0)

Copy Markdown

This rule transforms nested function calls into pipelines.

Configuration

This rule is enabled by default, but can be disabled globally in the configuration file. Also, functions that should be ignored can be configured with the ignore_functions option.

The rule can also be configured to ignore specific files, or specific lines in specific files. This is useful for cases where applying the rule would be problematic.

In .formatter.exs:

  green: [
    prefer_pipelines: [
      enabled: *true | false,
      ignore_functions: ["My.Module.foo": 1],
      except: [
        "path/to/file.exs",
        {"path/to/other_file.exs", 42},
        {"path/to/yet_another_file.exs", [10, 20, 30]}
      ]
    ]
  ]