Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Grundkiewicz <romang@amu.edu.pl>2017-06-05 13:45:13 +0300
committerRoman Grundkiewicz <romang@amu.edu.pl>2017-06-05 13:45:13 +0300
commit8c9743121b5b397a02eef0218af1d5a3fd691788 (patch)
tree4bf67660bc19e07fa93b66bd351b46e0f07130d8 /contrib
parentf734c82b041944e85190df2190a13559c7f9e687 (diff)
Add autoformat.sh script
Diffstat (limited to 'contrib')
-rw-r--r--contrib/README.md8
-rwxr-xr-xcontrib/autoformat.sh3
2 files changed, 9 insertions, 2 deletions
diff --git a/contrib/README.md b/contrib/README.md
index d58b7719..68282be4 100644
--- a/contrib/README.md
+++ b/contrib/README.md
@@ -11,7 +11,11 @@ Main code style rules:
* no space between control statements and opening brackets
Alternatively, use the provided `.clang-format` file for
-[ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) to format new code fragments, e.g.
+[ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) to format new code
+fragments, e.g.
- clang-format-3.8 -style=./contrib/.clang-format <source-or-header-file>
+ clang-format-3.8 <path_to_file>
+*Notice*: If you want to merge your changes from the repository cloned before
+autoformatting on all files in the _master_ repository, you may want to use the
+`autoformat.sh` script on your files before the merge.
diff --git a/contrib/autoformat.sh b/contrib/autoformat.sh
new file mode 100755
index 00000000..71d678ed
--- /dev/null
+++ b/contrib/autoformat.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+find ./src -path ./src/3rd_party -prune -o -iname *.h -o -iname *.cpp | xargs clang-format-3.8 -i