Skip to content

Conversation

J494-bit
Copy link

Me gustaría probar

@J494-bit
Copy link
Author

Go

Julow and others added 24 commits May 25, 2023 10:21
The ocp-indent rule works on the output of the corresponding test rule
instead of the reference file in the source tree.
This remove the need to call `runtest` a second time.
* Fix crash with exp-grouping and if-then-else

The formatting for if-then-else did not account for the begin-end in
some cases and generated invalid syntax.
The crash was caused by an Ast rule that is outdated since #2191.
* Make Cmt.t abstract

Preliminary to changing its representation.

* Don't mix comments and docstrings

Comments and docstrings no longer have to be differentiated before
formatting. Concatenating "*" to docstrings is no longer necessary.

Some comments starting with `(**` were in fact not docstrings.
What is a docstring is now dictated by the lexer, which removes this
kind of bug.
Code block containing non-ascii characters, even if not encoded using latin1, raise this alert:

    Alert deprecated: ISO-Latin1 characters in identifiers

Similarly to the warning 50 and because formatting of code block is on a
best-effort basis, this alert is disabled.
* Simplify escaping of '+' and '-'

* Don't escape `@` in the middle of a word

The `@` char must be escaped at the beginning of a word to not be
confused with tags. This escaping is not necessary in the middle of a
word and is removed.
* Don't escape balanced brackets in code spans

Odoc accepts nested balanced angle brackets in code spans:

    [ [] \] \[ ]

This removes the unecessary escaping.

* Add a test for re-escaping changing the comment
* Preserve blank lines in docstrings

We were always adding empty lines before and after paragraphs, even when
they are not necessary.

Empty lines are now added only when necessary or if they are present in
the original source file. This is computed by comparing locations.
* Generate an HTML output to debug boxes

* Move box debugging to a new top-level module

To make the `Fmt` module more readable and emphasis that it's separated
(it doesn't depend on the internal module `T`)

---------

Co-authored-by: Jules Aguillon <jules@j3s.fr>
* CI: Split workflows for Linux and other platforms

This makes test-branch faster as it doesn't have to wait for the macos
and windows build to finish, which are usually very slow.

This also removes the need to guard some steps with ifs. More ifs would
be needed soon.

* CI: Install the default repository on Windows

The windows build has been failing since the dependency on cmdliner has
been bumped.

The repository used in the windows environment is outdated, the default
repository must be added as a secondary repository.

* CI: Bump the ocaml version to 4.14
In `wrap-docstrings=false` mode, the uneeded box around code spans cause
a break.
A floating doc being the first item of a class type would have an
extraneous newline before them.

Floating docs in other position would cause the indentation of the class
type to be increased by one.
The new syntax rewrite introduced in #2282 is not compatible with 4.02.

The default value for the `ocaml-version` option is 4.04 but users are
still supporting OCaml 4.02.

`test/passing/tests/record-402.ml.ref` parse on 4.02.
`test/passing/tests/record.ml.ref` parse on 4.03.

The tests that are specifically about the newer syntax are moved into an
other test.

* Merge tests `record_identity` and `record_punning`
* tools/preview_new_release.sh: Simplify and style changes

- Make the `-p` not optional. The default value was harmful and I was
  not happy with uncertain values being passed to `rm -rf`.

- Take URL prefixes as `-u` and `-y` instead of user names. The
  constructed URL doesn't work in every setup and is better provided
  directly.

- Build ocamlformat.

- Push the result to the fork repository.

- Arguments are quoted when needed and other style changes.

More reproducible than depending on installing it first in Opam.

* Prune some mirage projects to reduce noise

These projects have similar codebase and are maintained by a small
number of people.

* test-extra: Add ppxlib

Ppxlib has unusual code and is a good target for the tests.

* test-extra: Prune some projects

Remove owl, which was not tested, sub-libraries of core, which all have
similar code and index, which has similar code to irmin.

* tools/projects.data: Remove flow

It uses an old version of OCamlformat, the diff is too big to be useful.
It's also not upgradable automatically due to its Dune config.

* tools/projects.data: Remove owl

The project hasn't been upgraded since the removal of `align-cases` and
cannot be upgraded.
Printast fails to build since 5612a0f
These diffs were used to monitor the changes made to the parser but are
getting in the way of making more changes.
The patch files were out of sync.
* ocp-indent-compat: Don't unindent unwrapped docstrings

In ocp-indent-compat mode, the indentation of unwrapped docstrings is
based on the indentation of the first line.

This applies to the janestreet profile.
* Preserve line break between operator and let

`@@ let` used to always break while `@@ let+` used to always align.
This was changed in 913f754 to always break in both cases for
consistency.

Now, the break is preserved except in the case of a plain `let`.
Preserving the line break on `let` do not reduce the regressions with
the previous version and unecessarily give more use cases to this
unwanted feature.

This applies to `let<op>`, `let exception` and `let module`.
- Preserve the formatting of the version option, this is required by Dune.
- Update the .git-blame-ignore-revs file. This seems welcome, except in Dune where it must be disabled.
- Add tarides/ocaml-platform-installer to the list
- The list is sorted.
A let-binding can have a newtype and a coercion at the same time. This
is fixed by removing the coupling between the two.
EmileTrotignon and others added 30 commits April 11, 2025 17:57
…nstraint-fix

promote test from #2678 and update changelog
* showcase issue

* fix issue

* add test and changelog
* fix floating doc comments interaction with `;;` expressions

* changelog
* `last_arg` and `has_label` is computed from context, `label` is given in `pro`.
* fix doc comment interaction with ;;

* changelog

* clearer changelog

* fmt
* encode the information of attribute and extension position in the AST

* remove using of source to check extension syntax

* format

* fix bug

* add test

* fix comment in between % and ext

* changes

* fix beginend
- add Space like before
- format postfix atributes in postfix position.

* add attribute test

* consistent infix attributes spacing

* add test from issue #2652

* remove extra parens

* format

* fmt
* apply begin fun on one line

* fmt

* changelog

* showcase infix apply begin function issue

* fix infix apply begin function issue
This introduces a workflow for dune package management. It would help us ensure the package builds with dune developer preview
* showcase issue

* fix issue

* changelog
While we want to keep an eye on this, we don't want to make it a hard requirement
* promote ocp docking ofr infix apply.

* fmt

* changelog
* fix crash with inline record type variable

* update changelog

* promote tests
* fix: handle case where doc does not lex as ocaml

Fixes #2679

Formatting `mld` files can crash when the input file cannot be lexed as
ocaml. This can happen with LaTeX is found in `{m ...}` or C code in
`{@c[ ... ]}`, for example.

In that case we would crash when building the list of tokens in the
file; however it's not used in the `mld` case.
* fix a crash with type%e nonrec

* add attributes test

* changelog

* fmt
* showcase issue

* solve issue
This doesn't make OCamlformat able to format 5.4 code.
* Add module-indent argument

* Use module-indent option to indent structs and sigs

* Add tests for module-indent option

* Update documentation for module-indent option
* test_branch: Use `--no-comment-check`

A test case added a misplaced doc-string, causing a fatal warning and
failing `test_branch` in CI.
This passes `--no-comment-check` to ignore this error.
* Basic OCaml 5.4 support

- update vendored parsers to mirror upstream at 5.4:
  * introduce locations for Longident.t components
  * distinguish (module M:S) and ((module M):(module S)) for expressions
- support for new syntaxes:
  * bivariance
  * labelled tuples

* Add test for labeled tuples

* review: lax rule for variance annotation

* review: test comments inside tuple types

* review: track labels locations in tuple types

* Locations for labels

* Concrete node for tuple element punning
* parser-standard: Reduce diffs with upstream

Promote small differences that do not change the parser's behavior to
parser-standard.
This will make future updates easier.

* parser-extended: Reduce diffs with parser-standard

This slightly reduce the difference between the two vendored parser in
the hope of making the future update easier.
* Bin_conf: don't pass info to update_using_cmdline

There is only a single instance anyway.

* Bin_conf: parse cmdline only once and cache result

Otherwise the config parser would run for every argument, resulting in
quadratic parsing.
Set 'TERM=dumb' to workaround unstable output from Cmdliner
Cmdliner output makes the tests unstable and cf3d2e7 did not fix the
issue. For example, the lower-bounds test in ocaml-ci fails.
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

Successfully merging this pull request may close these issues.