Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
3b43129b
Commit
3b43129b
authored
2 years ago
by
Patrick Baudin
Committed by
Andre Maroneze
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[lint] handles indent formatter without update command
parent
8c62390a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/lint/lint.ml
+4
-2
4 additions, 2 deletions
tools/lint/lint.ml
with
4 additions
and
2 deletions
tools/lint/lint.ml
+
4
−
2
View file @
3b43129b
...
@@ -56,7 +56,7 @@ type formatter_cmds =
...
@@ -56,7 +56,7 @@ type formatter_cmds =
{
mutable
is_available
:
bool
option
;
{
mutable
is_available
:
bool
option
;
available_cmd
:
string
;
available_cmd
:
string
;
check_cmd
:
string
;
check_cmd
:
string
;
update_cmd
:
string
update_cmd
:
string
(* leaves it empty if there is no updating command *)
}
}
let
c_indent_formatter
=
let
c_indent_formatter
=
...
@@ -290,7 +290,9 @@ let check_indent ~indent_formatter ~update file =
...
@@ -290,7 +290,9 @@ let check_indent ~indent_formatter ~update file =
if
not
@@
is_formatter_available
indent_formatter
then
true
if
not
@@
is_formatter_available
indent_formatter
then
true
else
if
not
update
then
else
if
not
update
then
0
=
Sys
.
command
(
Format
.
sprintf
"%s
\"
%s
\"
"
indent_formatter
.
check_cmd
file
)
0
=
Sys
.
command
(
Format
.
sprintf
"%s
\"
%s
\"
"
indent_formatter
.
check_cmd
file
)
else
0
=
Sys
.
command
(
Format
.
sprintf
"%s
\"
%s
\"
"
indent_formatter
.
update_cmd
file
)
else
if
indent_formatter
.
update_cmd
<>
""
then
0
=
Sys
.
command
(
Format
.
sprintf
"%s
\"
%s
\"
"
indent_formatter
.
update_cmd
file
)
else
true
(* there no updating command *)
let
res
=
ref
true
let
res
=
ref
true
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment