From 317595dc7293dcef132373163298bd08e66e47b4 Mon Sep 17 00:00:00 2001 From: uberspot Date: Tue, 11 Mar 2014 23:40:12 +0200 Subject: [PATCH] Added initial xml and readme info for checkstyle --- README.md | 8 + tools/checkstyle | 1 + tools/checkstyle.xml | 356 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 365 insertions(+) create mode 100755 tools/checkstyle create mode 100644 tools/checkstyle.xml diff --git a/README.md b/README.md index 14a9055e9..4b997c59f 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,14 @@ See http://source.android.com/source/code-style.html See http://www.androidpolice.com/2009/11/04/auto-formatting-android-xml-files-with-eclipse/ +### Automated syntax check with CheckStyle +* Paste the tools/checkstyle.xml file to ~/.AndroidStudioPreview/config/codestyles/ (in Linux/Unix) + or ~/Library/Preferences/AndroidStudioPreview/codestyles (in Mac OSX) +* Go to Settings (or Preferences in Mac OS X) > Code Style > Java, select OpenPgpChecker, + as well as Code Style > XML and select OpenPgpChecker again. +* Start code inspection and see the results by selecting Analyze > Inspect Code from Android-Studio + or you can directly run checkstyle via cli with .tools/checkstyle. Make sure it's executable first. + ## Licenses OpenPGP Kechain is licensed under GPLv3+. Some parts (older parts and some libraries are Apache License v2, MIT X11 License) diff --git a/tools/checkstyle b/tools/checkstyle new file mode 100755 index 000000000..27aabced2 --- /dev/null +++ b/tools/checkstyle @@ -0,0 +1 @@ +checkstyle -c tools/checkstyle.xml -r OpenPGP-Keychain/src/main/java 2>&1 | egrep -v 'log4j' diff --git a/tools/checkstyle.xml b/tools/checkstyle.xml new file mode 100644 index 000000000..95ef07a90 --- /dev/null +++ b/tools/checkstyle.xml @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +