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
8417372e
Commit
8417372e
authored
2 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[Lint] using generic rules as much as possible
parent
db7513a5
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
share/Makefile.linting
+22
-66
22 additions, 66 deletions
share/Makefile.linting
with
22 additions
and
66 deletions
share/Makefile.linting
+
22
−
66
View file @
8417372e
...
@@ -128,28 +128,19 @@ endif
...
@@ -128,28 +128,19 @@ endif
.PHONY
:
clean-lint
.PHONY
:
clean-lint
clean-lint
:
clean-lint
:
echo
"Cleaning LINT targets..."
echo
"Cleaning LINT targets..."
$(
RM
)
-r
.lint
rm
-r
f
.lint
clean
::
clean-lint
clean
::
clean-lint
.PHONY
:
clean-check-eoleof
#### clean-check-XXX targets
clean-check-eoleof
:
echo
"Cleaning LINT
$(
patsubst clean-%,%,
$@
)
targets..."
find .lint
-type
f
-name
\*
.
$(
patsubst clean-%,%,
$@
)
| xargs
-n
10
$(
RM
)
.PHONY
:
clean-check-utf8
LINT.clean-targets
=
\
clean-check-utf8
:
clean-check-eoleof clean-check-utf8 clean-check-syntax clean-check-ident
echo
"Cleaning LINT
$(
patsubst clean-%,%,
$@
)
targets..."
.PHONY
:
clean-check-eoleof clean-check-utf8 clean-check-syntax clean-check-ident
find .lint
-type
f
-name
\*
.
$(
patsubst clean-%,%,
$@
)
| xargs
-n
10
$(
RM
)
.PHONY
:
clean-check-syntax
# Generic rule
clean-check-syntax
:
$(LINT.clean-targets)
:
echo
"Cleaning LINT
$(
patsubst clean-%,%,
$@
)
targets..."
echo
"[LINT] Cleaning
$(
patsubst clean-%,%,
$@
)
targets..."
find .lint
-type
f
-name
\*
.
$(
patsubst clean-%,%,
$@
)
| xargs
-n
10
$(
RM
)
.PHONY
:
clean-check-ident
clean-check-indent
:
echo
"Cleaning LINT
$(
patsubst clean-%,%,
$@
)
targets..."
find .lint
-type
f
-name
\*
.
$(
patsubst clean-%,%,
$@
)
| xargs
-n
10
$(
RM
)
find .lint
-type
f
-name
\*
.
$(
patsubst clean-%,%,
$@
)
| xargs
-n
10
$(
RM
)
###############################
###############################
...
@@ -160,69 +151,34 @@ ifeq ($(LINT_FILE),)
...
@@ -160,69 +151,34 @@ ifeq ($(LINT_FILE),)
LINT.dir
=
$(
wildcard
$(
LINT_DIR
))
LINT.dir
=
$(
wildcard
$(
LINT_DIR
))
.PHONY
:
check-utf8
#### check-XXX targets
check-utf8
:
echo
"Checking UTF8..."
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$@
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
.PHONY
:
fix-utf8
LINT.check-targets
=
\
fix-utf8
:
check-syntax check-indent check-eoleof check-utf8
echo
"Fixing UTF8..."
.PHONY
:
check-syntax check-indent check-eoleof check-utf8
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$(
patsubst fix-%,check-%,
$@
)
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
.PHONY
:
check-eoleof
# Generic rule
check-eoleof
:
$(LINT.check-targets)
:
echo
"Checking
EOL EOF
..."
echo
"
[LINT]
Checking
from GIT attribute
$@
..."
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$@
\
|
$(
GIT
)
check-attr
--stdin
-z
$@
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
.PHONY
:
fix-eoleof
#### fix-XXX targets
fix-eoleof
:
echo
"Fixing EOL EOF..."
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$(
patsubst fix-%,check-%,
$@
)
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
.PHONY
:
check-syntax
LINT.fix-targets
=
\
check-syntax
:
fix-eoleof fix-utf8 fix-syntax fix-ident
echo
"Checking syntax..."
.PHONY
:
fix-eoleof fix-utf8 fix-syntax fix-ident
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$@
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
.PHONY
:
fix-syntax
# Generic rule
fix-syntax
:
$(LINT.fix-targets)
:
echo
"
Fixing syntax
..."
echo
"
[LINT] Fixing from GIT attribute
$(
patsubst fix-%,check-%,
$@
)
..."
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$(
patsubst fix-%,check-%,
$@
)
\
|
$(
GIT
)
check-attr
--stdin
-z
$(
patsubst fix-%,check-%,
$@
)
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
.PHONY
:
check-indent
check-indent
:
echo
"Checking indent..."
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$@
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
.PHONY
:
fix-indent
fix-indent
:
echo
"Fixing indent..."
$(
GIT
)
ls-files
$(
LINT.dir
)
-z
\
|
$(
GIT
)
check-attr
--stdin
-z
$(
patsubs fix-,check-,
$@
)
\
|
$(
SED
)
-zne
'x;n;n;s/^set$$//;t print;b;:print;x;p'
\
| xargs
--null
-IXX
sh
-c
'
$(
LINT.make
)
LINT_FILE="XX" $@ || exit 255'
else
# LINT_FILE are given
else
# LINT_FILE are given
...
...
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