Skip to content

Should check for existence of --argument instead of fallingback to <inline source>? #800

Description

@knocte

Given this current behaviour of fsharplint:

% dotnet fsharplint test 
ERROR: unrecognized argument: 'test'.
USAGE: fsharplint [--help] [--format <standard|msbuild>] [--version] [<subcommand> [<options>]]

SUBCOMMANDS:

    lint <options>        Runs FSharpLint against a file or a collection of files.

    Use 'fsharplint <subcommand> --help' for additional information.

OPTIONS:

    --format, -f <standard|msbuild>
                          Output format of the linter.
    --version             Prints current version.
    --help                display this list of options.

And this:

% dotnet fsharplint --hlep                                          
ERROR: unrecognized argument: '--hlep'.
USAGE: fsharplint [--help] [--format <standard|msbuild>] [--version] [<subcommand> [<options>]]

SUBCOMMANDS:

    lint <options>        Runs FSharpLint against a file or a collection of files.

    Use 'fsharplint <subcommand> --help' for additional information.

OPTIONS:

    --format, -f <standard|msbuild>
                          Output format of the linter.
    --version             Prints current version.
    --help                display this list of options.

And this:

% dotnet fsharplint lint --help
USAGE: fsharplint lint [--help] [--lint-config <lintConfig>] [--file-type <project|solution|file|source>] <target>

TARGET:

    <target>              Input to lint.

OPTIONS:

    --lint-config, -l <lintConfig>
                          Path to the config for the lint.
    --file-type <project|solution|file|source>
                          Input type the linter will run against. If this is not set, the file type will be inferred from the file extension.
    --help                display this list of options.

Then, it's only logical to assume that, executing command dotnet fsharplint lint --hlep (current results: ========== Linting <inline source> ==========\n========== Finished: 0 warnings ==========\n========== Summary: 0 warnings ==========) should return something like:

ERROR: unrecognized argument: '--hlep'.
USAGE: fsharplint lint [--help] [--lint-config <lintConfig>] [--file-type <project|solution|file|source>] <target>

TARGET:

    <target>              Input to lint.

OPTIONS:

    --lint-config, -l <lintConfig>
                          Path to the config for the lint.
    --file-type <project|solution|file|source>
                          Input type the linter will run against. If this is not set, the file type will be inferred from the file extension.
    --help                display this list of options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions