<commit_before>Invalid version:

  $ echo 'version = bad' > .ocamlformat
  $ echo 'let x = "Hello World"' > a.ml

Exit code is printed by hand because sed succeeding would hide the error.

  $ (<a.ml ocamlformat --impl -; echo [$?]) 2>&1 | sed 's/version is "[^"]*"/version is "..."/g'
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Project should be formatted using ocamlformat version "bad", but the installed version is "..."
  [1]

Invalid syntax in .ocamlformat file:

  $ echo 'a = b = c' > .ocamlformat
  $ echo 'let x = 1"' | ocamlformat --impl -
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Invalid format "a = b = c"
  [1]

Invalid option:

  $ echo 'unknown_option = true' > .ocamlformat
  $ echo 'let x = 1' | ocamlformat --impl -
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Unknown option "unknown_option"
  [1]

Invalid option (short negated form):

  $ echo 'no-wrap-comments' > .ocamlformat
  $ echo 'let x = 1' | ocamlformat --impl -
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Unknown option "no-wrap-comments": "no-wrap-comments" is the short form for "wrap-comments=false". It is only accepted on command line, please use "wrap-comments=false" or "wrap-comments=true" instead.<commit_msg>Add a test for 'no-version-check' (#2177)<commit_after>Invalid version:

  $ echo 'version = bad' > .ocamlformat
  $ echo 'let x = "Hello World"' > a.ml

Exit code is printed by hand because sed succeeding would hide the error.

  $ (<a.ml ocamlformat --impl -; echo [$?]) 2>&1 | sed 's/version is "[^"]*"/version is "..."/g'
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Project should be formatted using ocamlformat version "bad", but the installed version is "..."
  [1]

Disable version check:

  $ (<a.ml ocamlformat --impl --no-version-check -; echo [$?]) 2>&1 | sed 's/version is "[^"]*"/version is "..."/g'
  let x = "Hello World"
  [0]

Invalid syntax in .ocamlformat file:

  $ echo 'a = b = c' > .ocamlformat
  $ echo 'let x = 1"' | ocamlformat --impl -
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Invalid format "a = b = c"
  [1]

Invalid option:

  $ echo 'unknown_option = true' > .ocamlformat
  $ echo 'let x = 1' | ocamlformat --impl -
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Unknown option "unknown_option"
  [1]

Invalid option (short negated form):

  $ echo 'no-wrap-comments' > .ocamlformat
  $ echo 'let x = 1' | ocamlformat --impl -
  ocamlformat: Error while parsing $TESTCASE_ROOT/.ocamlformat:
               Unknown option "no-wrap-comments": "no-wrap-comments" is the short form for "wrap-comments=false". It is only accepted on command line, please use "wrap-comments=false" or "wrap-comments=true" instead.
{'fraction_non_alphanumeric': 0.13301004502944233, 'fraction_numerical': 0.00796674748874264, 'mean_word_length': 3.073342736248237, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '457317', 'n_tokens_mistral': 970, 'n_tokens_neox': 911, 'n_words': 314}