-
Notifications
You must be signed in to change notification settings - Fork 414
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
Avoid formatting read-only files #11490
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,10 @@ Note about versioning: | |
- in (lang dune 1.x), no formatting rules are set up by default. | ||
- (lang dune 2.0) behaves as if (using fmt 1.2) is set. | ||
|
||
Turn every symlinks into writable files belonging to the sandbox as formatting | ||
rules are not generated for read-only files: | ||
$ find . -type l | while read f; do (rm "$f"; cat > $f) < $f; done | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't this be easier with (OTOH fairly impressed it even works, reading the file and replacing it in one step) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the files (but not the directories) in the cram test's current directory are symlinks to read-only copies of the source code. This breaks
|
||
|
||
Formatting can be checked using the @fmt target: | ||
|
||
$ touch .ocamlformat | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment on these
chmod
s why this is necessary? Someone unaware of that functionality will probably wonder what is going on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for the same reason as #11490 (comment) in
feature.t
. I wonder if there's a better way to do it ?