Skip to content

Deterministic file type detection #2166

@pyfisch

Description

@pyfisch

Description of the problem or steps to reproduce

#2163 showed that the filetype detection is not deterministic: if multiple detect rules match a given filename a random filetype is chosen that varies between executions. At minimum each invocation of micro should detect the same file type. An additional measure may be to warn or error if the file is detected as multiple types.

I think it would be preferable that if both a built-in detect rule and a user provided detect rule exist only the latter is used. This would allow users to overwrite detection rules without recompiling micro.

Specifications

Version: 2.0.5-dev.279
Commit hash: c98239d
Compiled on July 21, 2021

Commit hash: 6e1fe5b
OS: Linux
Terminal: alacritty

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