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
5343b289
Commit
5343b289
authored
2 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[Lint] Adds clang-format checker for E-ACSL
parent
1e86202d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
share/Makefile.linting
+40
-7
40 additions, 7 deletions
share/Makefile.linting
src/plugins/e-acsl/.gitattributes
+7
-1
7 additions, 1 deletion
src/plugins/e-acsl/.gitattributes
with
47 additions
and
8 deletions
share/Makefile.linting
+
40
−
7
View file @
5343b289
...
...
@@ -103,6 +103,13 @@ endif
$(
MKDIR
)
$(
dir
$@
)
$(
TOUCH
)
$@
.lint/check-clang-format-installed
:
if
!
command
-v
clang-format
>
/dev/null
;
then
\
echo
"error: clang-format must be installed"
;
\
exit
1
;
\
fi
;
mkdir
-p
$(
dir
$@
)
###############
## Main target
...
...
@@ -135,8 +142,10 @@ clean:: clean-lint
#### clean-check-XXX targets
LINT.clean-targets
=
\
clean-check-eoleof clean-check-utf8 clean-check-syntax clean-check-ident
.PHONY
:
clean-check-eoleof clean-check-utf8 clean-check-syntax clean-check-ident
clean-check-eoleof clean-check-utf8 clean-check-syntax
\
clean-check-indent clean-check-clang-format
.PHONY
:
clean-check-eoleof clean-check-utf8 clean-check-syntax
\
clean-check-indent clean-check-clang-format
# Generic rule
$(LINT.clean-targets)
:
...
...
@@ -154,8 +163,8 @@ LINT.dir=$(wildcard $(LINT_DIR))
#### check-XXX targets
LINT.check-targets
=
\
check-syntax check-indent check-eoleof check-utf8
.PHONY
:
check-syntax check-indent check-eoleof check-utf8
check-syntax check-indent
check-clang-format
check-eoleof check-utf8
.PHONY
:
check-syntax check-indent
check-clang-format
check-eoleof check-utf8
# Generic rule
$(LINT.check-targets)
:
...
...
@@ -168,8 +177,8 @@ $(LINT.check-targets):
#### fix-XXX targets
LINT.fix-targets
=
\
fix-eoleof fix-utf8 fix-syntax fix-ident
.PHONY
:
fix-eoleof fix-utf8 fix-syntax fix-ident
fix-eoleof fix-utf8 fix-syntax fix-i
n
dent
fix-clang-format
.PHONY
:
fix-eoleof fix-utf8 fix-syntax fix-i
n
dent
fix-clang-format
# Generic rule
$(LINT.fix-targets)
:
...
...
@@ -190,11 +199,13 @@ LINT_FILE.check-utf8= $(addsuffix .check-utf8,$(LINT_FILE.list))
LINT_FILE.check-eoleof
=
$(
addsuffix .check-eoleof,
$(
LINT_FILE.list
))
LINT_FILE.check-syntax
=
$(
addsuffix .check-syntax,
$(
LINT_FILE.list
))
LINT_FILE.check-indent
=
$(
addsuffix .check-indent,
$(
LINT_FILE.list
))
LINT_FILE.check-clang-format
=
$(
addsuffix .check-clang-format,
$(
LINT_FILE.list
))
LINT_FILE.fix-utf8
=
$(
addsuffix .fix-utf8,
$(
LINT_FILE.list
))
LINT_FILE.fix-eoleof
=
$(
addsuffix .fix-eoleof,
$(
LINT_FILE.list
))
LINT_FILE.fix-syntax
=
$(
addsuffix .fix-syntax,
$(
LINT_FILE.list
))
LINT_FILE.fix-indent
=
$(
addsuffix .fix-indent,
$(
LINT_FILE.list
))
LINT_FILE.fix-clang-format
=
$(
addsuffix .fix-clang-format,
$(
LINT_FILE.list
))
## check-XXX targets
...
...
@@ -210,6 +221,9 @@ check-syntax: $(LINT_FILE.check-syntax)
.PHONY
:
check-indent
check-indent
:
$(LINT_FILE.check-indent)
.PHONY
:
check-clang-format
check-clang-format
:
$(LINT_FILE.check-clang-format)
## fix-XXX targets
.PHONY
:
fix-utf8
...
...
@@ -224,6 +238,9 @@ fix-syntax: $(LINT_FILE.fix-syntax)
.PHONY
:
fix-indent
fix-indent
:
$(LINT_FILE.fix-indent)
.PHONY
:
fix-clang-format
fix-clang-format
:
$(LINT_FILE.fix-clang-format)
endif
###############################
...
...
@@ -262,7 +279,7 @@ $(LINT_FILE.fix-utf8): .lint/%.fix-utf8: % .lint/check-ocp-indent-version
endif
# LINT_FROM_ENCODING
###############################
## INDENTATION ASPECT
##
ML
INDENTATION ASPECT
$(LINT_FILE.check-indent)
:
.lint/%.check-indent: % .lint/check-ocp-indent-version
echo
"Check indent:
$<
"
...
...
@@ -285,6 +302,22 @@ $(LINT_FILE.fix-indent): .lint/%.fix-indent: % .lint/check-ocp-indent-version
$(
MKDIR
)
$(
dir
$@
)
$(
TOUCH
)
.lint/
$<
.check-indent
# no more need of check-indent
###############################
## C INDENTATION ASPECT
$(LINT_FILE.check-clang-format)
:
.lint/%.check-clang-format: % .lint/check-clang-format-installed
echo
"Check clang-format:
$<
"
clang-format
--dry-run
-Werror
$<
$(
MKDIR
)
$(
dir
$@
)
$(
TOUCH
)
$@
.PHONY
:
$(LINT_FILE.fix-clang-format)
$(LINT_FILE.fix-clang-format)
:
.lint/%.fix-clang-format: % .lint/check-clang-format-installed
echo
"Fixes clang-format:
$<
"
clang-format
-i
$<
$(
MKDIR
)
$(
dir
$@
)
$(
TOUCH
)
.lint/
$<
.check-indent
# no more need of check-indent
###############################
## EOL EOF ASPECT (included by check-syntax target)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/e-acsl/.gitattributes
+
7
−
1
View file @
5343b289
...
...
@@ -23,6 +23,13 @@ Makefile.in header_spec=CEA_LGPL_OR_PROPRIETARY.E_ACSL
/scripts/e-acsl-gcc.sh.comp header_spec=CEA_LGPL_OR_PROPRIETARY.E_ACSL
/scripts/e-acsl-gcc.sh.comp header_spec=CEA_LGPL_OR_PROPRIETARY.E_ACSL
###########################################
# CHECK-INDENT #
###########################################
/tests/*/*.c check-clang-format
/share/**/*.c check-clang-format
########################
# HEADER_SPEC: .ignore #
########################
...
...
@@ -69,4 +76,3 @@ README header_spec=.ignore
/tests/E_ACSL_test.ml header_spec=CEA_LGPL_OR_PROPRIETARY.E_ACSL
/contrib/libdlmalloc/dlmalloc.* header_spec=MODIFIED_DLMALLOC
/share/e-acsl/internals/e_acsl_rtl_io.* header_spec=MODIFIED_SPARETIMELABS
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