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

Fpath #7

Merged
merged 2 commits into from
Nov 16, 2023
Merged

Fpath #7

merged 2 commits into from
Nov 16, 2023

Conversation

mbarbin
Copy link
Owner

@mbarbin mbarbin commented Nov 12, 2023

Internal refactoring.

Using fpath

Rename most file path variables from filename to path and switch from type string to Fpath.t.

-| filename:string
+| path:Fpath.t

Extract some libraries into their own packages

Extract some libraries into their own packages to reuse in other projects: loc, error-log, parsing-utils.

The parts of parsing-utils that relates to auto-format have been separated out and published as a new package auto-format.

In the process of doing that, the interface of the fmt command changed slightly: now the extension is configured in the code and doesn't need to be supplied at each of the dune files invocations.

For example:

 |  (with-stdout-to
 |   dune.inc.gen
 |   (pipe-stdout
-|    (bash "%{bin:bopkit} fmt gen-dune .bop -- \%{bin:bopkit} fmt file")
+|    (bash "%{bin:bopkit} fmt gen-dune -- \%{bin:bopkit} fmt file")
 |     (run dune format-dune-file)))))

1. Rename most file path variables from [filename] to [path] and switch
   from type [string] to [Fpath.t]

```diff
- filename:string
+ path:Fpath.t
```

2. Extract some libraries into their own packages to reuse in other
   projects: loc, error-log, parsing-utils.

In the process of doing [2], the interface of the [fmt] command
changed slightly: now the extension is configured in the code and
doesn't need to be supplied in the dune files invocations.

For example:

```diff
  (with-stdout-to
    dune.inc.gen
    (pipe-stdout
-    (bash "%{bin:bopkit} fmt gen-dune .bop -- \%{bin:bopkit} fmt file")
+    (bash "%{bin:bopkit} fmt gen-dune -- \%{bin:bopkit} fmt file")
     (run dune format-dune-file)))))
```
@mbarbin mbarbin merged commit 66e45dd into main Nov 16, 2023
4 checks passed
@mbarbin mbarbin deleted the fpath branch January 17, 2024 17:24
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.

1 participant