#9autofmt: configuration file

  • avatar~clovercommented · 1 year ago
    Author
    Owner

    the intent is not to make autofmt a tool like dprint or treefmt, but still a tool that can format any file correctly. this messed up fish's workflow when a formatter was used on package.json on a repo that only uses prettier to format js files. while i think the repo is wrong for this and prettier --write . would format the file, autofmt should be configurable.

    the issue is some projects do not format their files at all. we should add these configuration options:

    • reset do not inherit config
    • includeAmbiguousInRepos change the default behavior of autofmt to not pick a default formatter, and defaulting this to false
    • disabledLanguages array of language names to disable formatting on
    • disabledExtensions array of extensions to disable formatting on
    • disabledFiles array of relative glob patterns to disable formatting on

    when autofmt looks to format a file, it should read all .autofmt configurations in all parent directories, including past git boundaries, until it reaches one with reset

    oh, additionally, formatters should probably be able to specify exclude patterns, like .prettierignore to add more ways to disqualify a file.

  • avatar~clover changed the status to Todo · 1 year ago
  • avatar~clovercommented · 1 year ago
    Author
    Owner

    one other criteria, the nix config should exclude .autofmt from being committed to any git repository so that we do not dilute repositories with configuration for a tool that is literally supposed to avoid configuration