Skip to content

Convert to snake case#8456

Open
aspeddro wants to merge 4 commits into
rescript-lang:masterfrom
aspeddro:to-snake-case
Open

Convert to snake case#8456
aspeddro wants to merge 4 commits into
rescript-lang:masterfrom
aspeddro:to-snake-case

Conversation

@aspeddro
Copy link
Copy Markdown
Contributor

@aspeddro aspeddro commented May 31, 2026

  • Renamed OCaml filenames, let binding, type binding, parameters names and module names.
  • Renamed variant names (also expection names), some follow pascal case format, but in OCaml it's generally snake case (first letter capitalized, of course).

Close #8442

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.90%. Comparing base (7d96fe3) to head (14e194c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8456      +/-   ##
==========================================
- Coverage   60.93%   60.90%   -0.04%     
==========================================
  Files         374      374              
  Lines       54039    54084      +45     
==========================================
+ Hits        32930    32941      +11     
- Misses      21109    21143      +34     
Files with missing lines Coverage Δ
analysis/src/build_system.ml 50.00% <ø> (ø)
analysis/src/cache.ml 12.50% <ø> (ø)
analysis/src/cfg.ml 33.33% <ø> (ø)
analysis/src/cmt.ml 30.00% <ø> (ø)
analysis/src/completion_back_end.ml 0.00% <ø> (ø)
analysis/src/completion_expressions.ml 0.00% <ø> (ø)
analysis/src/completion_jsx.ml 0.00% <ø> (ø)
analysis/src/debug.ml 20.00% <ø> (ø)
analysis/src/dot_completion_utils.ml 0.00% <ø> (ø)
analysis/src/files.ml 47.22% <ø> (ø)
... and 91 more

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 31, 2026

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8456

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8456

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8456

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8456

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8456

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8456

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8456

commit: 14e194c

@aspeddro aspeddro marked this pull request as ready for review May 31, 2026 17:34
@cknitt
Copy link
Copy Markdown
Member

cknitt commented Jun 2, 2026

Oh no, sorry, I was too slow in reviewing , this has conflicts already. 😞 Could you rebase?

@aspeddro
Copy link
Copy Markdown
Contributor Author

aspeddro commented Jun 2, 2026

@cknitt we should rename variants names? See PR description

@aspeddro
Copy link
Copy Markdown
Contributor Author

aspeddro commented Jun 2, 2026

Rename the variants, but there are exceptions such as third-party library variants (Lsp, flow_parser).

@aspeddro
Copy link
Copy Markdown
Contributor Author

aspeddro commented Jun 2, 2026

I don't think it's a good idea to rename some variants (parsetree.ml, etc). I will revert

@JonoPrest
Copy link
Copy Markdown
Contributor

Out of interest, why are we renaming everything? Is it a new style guide? Seems to me like this touches so much maybe camel case should be the canonical choice.

@aspeddro
Copy link
Copy Markdown
Contributor Author

aspeddro commented Jun 2, 2026

OCaml style guide is snake case. Only analysis and tools use camel case

@JonoPrest
Copy link
Copy Markdown
Contributor

OCaml style guide is snake case. Only analysis and tools use camel case

Ah I see. The changes to the compiler are the call-sites 👍🏼

@cknitt
Copy link
Copy Markdown
Member

cknitt commented Jun 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10e5e9e16b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,14 +1,14 @@
(executable
(name ReactiveTest)
(name reactive_test)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the reactive test target name

When someone runs make test from analysis/reactive, the local Makefile still builds and executes test/ReactiveTest.exe, but this stanza now names the executable reactive_test, so Dune's target is test/reactive_test.exe and the documented local test command for this package fails until the Makefile is updated as well.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5bc7028

Comment thread compiler/gentype/gen_type_common.ml Outdated
module Config = GenTypeConfig
module String_map = Map.Make (String)
module String_set = Set.Make (String)
module Config = Gen_type_config
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to use gentype_ instead of gen_type_ everywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 14e194c

@cknitt
Copy link
Copy Markdown
Member

cknitt commented Jun 2, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread analysis/src/uri.ml
else Lsp.Uri.to_string t

(* Light weight, hopefully-enough-for-the-purpose fn to encode URI components.
Built to handle the reserved characters listed in
https://en.wikipedia.org/wiki/Percent-encoding. Note that this function is not
general purpose, rather it's currently only for URL encoding the argument list
passed to command links in markdown. *)
let encodeURIComponent text =
let encode_u_r_i_component text =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is also weird 🙂

@cknitt
Copy link
Copy Markdown
Member

cknitt commented Jun 3, 2026

Codex found some more:


I found two weird acronym splits introduced by this branch:

Likely intended names:

  • encode_uri_component
  • set_dce

I also saw these suspicious-looking names, but they were already present at 7d96fe3847900ff264618c222903678c52c063d6, so they were not introduced by this rename branch:

  • type_react_d_o_m_re_dom_ref
  • translate_c_m_t

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.

Convert OCaml codebase to snake case format

3 participants