Skip to content

Support Conditional Formatting and Extra Arguments #38

@barrettruth

Description

@barrettruth

In null-ls one can avoid formatting if a certain "condition" is not met like so:

        diagnostics.eslint_d.with({
            condition = function(utils)
                return utils.root_has_file({
                    {
                        '.eslintrc',
                        '.eslintrc.cjs',
                        '.eslintrc.yaml',
                        '.eslintrc.yml',
                        '.eslintrc.json',
                    },
                })
            end,
        }),

One can also pass extra arguments to a source:

        diagnostics.sqlfluff.with({
            extra_args = {
                '--dialect',
                'postgres',
                '--exclude-rules',
                'LT02,LT05',
            },
        }),

I think these are two more relevant features that are important to be implemented, although I think customizability should indeed be kept to a minimum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions