Skip to content

Commit

Permalink
import .clang-format from libslirp
Browse files Browse the repository at this point in the history
No substantial code change

Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Jul 12, 2019
1 parent 5c690f7 commit 3638722
Show file tree
Hide file tree
Showing 8 changed files with 1,174 additions and 1,051 deletions.
1 change: 1 addition & 0 deletions .clang-format
2 changes: 1 addition & 1 deletion Dockerfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ RUN ./autogen.sh && ./configure && make -j $(nproc)

FROM build AS test
USER 0
RUN apt update && apt install -y git indent libtool iproute2 clang clang-tidy iputils-ping iperf3 nmap jq
RUN apt update && apt install -y git libtool iproute2 clang clang-format clang-tidy iputils-ping iperf3 nmap jq
USER 1000:1000
CMD ["make", "ci"]
13 changes: 3 additions & 10 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,16 @@ generate-man:

CLANGTIDY = clang-tidy -warnings-as-errors='*'

CLANGFORMAT = clang-format

lint:
$(CLANGTIDY) $(slirp4netns_SOURCES) -- $(AM_CFLAGS)

lint-full:
$(CLANGTIDY) $(slirp4netns_SOURCES) $(libslirp_a_SOURCES) $(libparson_a_SOURCES) -- $(AM_CFLAGS)

indent:
# indent(1): "You must use the ‘-T’ option to tell indent the name of all the typenames in your program that are defined by typedef."
indent -linux -l120 \
-T ssize_t -T pid_t \
-T GArray -T GList -T GSList -T GPollFD -T gpointer -T gconstpointer \
-T Slirp -T SlirpCb -T SlirpConfig -T SlirpTimerCb \
-T JSON_Object -T JSON_Value \
-T regex_t -T regmatch_t \
$(slirp4netns_SOURCES)
$(RM) *.c~

$(CLANGFORMAT) -i $(slirp4netns_SOURCES)

benchmark:
benchmarks/benchmark-iperf3.sh
Expand Down
Loading

0 comments on commit 3638722

Please sign in to comment.