Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore files based on .ocamlformat or .ocamlformat-ignore file ? #605

Closed
hhugo opened this issue Feb 8, 2019 · 3 comments
Closed

Ignore files based on .ocamlformat or .ocamlformat-ignore file ? #605

hhugo opened this issue Feb 8, 2019 · 3 comments

Comments

@hhugo
Copy link
Collaborator

hhugo commented Feb 8, 2019

ocaml/dune#1793

@jberdine
Copy link
Collaborator

jberdine commented Feb 8, 2019

How much flexibility in terms of how many ignore files and where they are do you think would be needed? Would it suffice to have just one in the project root? Would a list of paths relative to the project root be enough, or are globs or regexps needed?

@hhugo
Copy link
Collaborator Author

hhugo commented Feb 8, 2019

Explicit filename, no regexp. either at the root or in sub-directories.
I'm not sure if it should live in ocamlformat or dune.

The use case is:

  • use dune+ocamlformat to format the js_of_ocaml codebase
  • some generated files (parsers, lexers) are committed in the tree but should not be reformatted.

@jberdine
Copy link
Collaborator

jberdine commented Feb 8, 2019

Internally we have makefiles that call find with various filters to select the files to be formatted and exclude others, so I think that the use case is reasonably general. It would be unfortunate for people to have to configure things twice, once for dune and once for the other invocations of ocamlformat. So unless we envision that people will only run ocamlformat via dune, then I think it makes sense to have support in ocamlformat. (FWIW, internally we do run ocamlformat from machines that do not have dune. I don't know whether to expect that to be common.) Also, if it is configured only in dune, how can we expect the editor integrations to do the right thing when an ignored file is edited and saved? On the other hand, it's nice to have fewer config files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants