From 6dbc8f6a96194cb223356e1cdee1c1ac657bc332 Mon Sep 17 00:00:00 2001 From: Grigory Ulanov Date: Fri, 16 Jun 2017 15:27:40 +0300 Subject: [PATCH] code quality added --- .gitmodules | 3 +++ .swiftlint.yml | 22 +--------------------- .tailor.yml | 4 +--- ARTest.xcodeproj/project.pbxproj | 15 +++++++++++++++ code-quality | 1 + cpd-output.xml | 2 ++ cpd_script.php | 1 + 7 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 .gitmodules mode change 100755 => 120000 .swiftlint.yml mode change 100755 => 120000 .tailor.yml create mode 160000 code-quality create mode 100644 cpd-output.xml create mode 120000 cpd_script.php diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..53b16c0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "code-quality"] + path = code-quality + url = https://github.com/TouchInstinct/code-quality-ios diff --git a/.swiftlint.yml b/.swiftlint.yml deleted file mode 100755 index d9cd508..0000000 --- a/.swiftlint.yml +++ /dev/null @@ -1,21 +0,0 @@ -disabled_rules: - - variable_name -excluded: - - Carthage - - Pods -line_length: 128 -type_body_length: - - 500 # warning - - 700 # error -file_length: - warning: 500 - error: 1200 -warning_threshold: 1 - -custom_rules: - uiwebview_disabled: - included: ".*.swift" - name: "UIWebView Usage Disabled" - regex: "(UIWebView)" - message: "Do not use UIWebView. Use WKWebView Instead. https://developer.apple.com/reference/uikit/uiwebview" - severity: error \ No newline at end of file diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 120000 index 0000000..0add564 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1 @@ +code-quality/.swiftlint.yml \ No newline at end of file diff --git a/.tailor.yml b/.tailor.yml deleted file mode 100755 index a460616..0000000 --- a/.tailor.yml +++ /dev/null @@ -1,3 +0,0 @@ -exclude: - - 'Pods' - - 'Carthage' \ No newline at end of file diff --git a/.tailor.yml b/.tailor.yml new file mode 120000 index 0000000..73afece --- /dev/null +++ b/.tailor.yml @@ -0,0 +1 @@ +code-quality/.tailor.yml \ No newline at end of file diff --git a/ARTest.xcodeproj/project.pbxproj b/ARTest.xcodeproj/project.pbxproj index 6dc1262..fca22c2 100644 --- a/ARTest.xcodeproj/project.pbxproj +++ b/ARTest.xcodeproj/project.pbxproj @@ -96,6 +96,7 @@ 0AC0DA3C1EE99233006E2CC9 /* Resources */, 0AA8505A1EF3FB4E00353B55 /* SwiftLint */, 0AA8505B1EF3FBE200353B55 /* Tailor */, + 0AA8505F1EF404A800353B55 /* CopyPaste Detection */, ); buildRules = ( ); @@ -182,6 +183,20 @@ shellPath = /bin/sh; shellScript = "if hash tailor 2>/dev/null; then\ntailor\nfi"; }; + 0AA8505F1EF404A800353B55 /* CopyPaste Detection */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "CopyPaste Detection"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Running CPD\npmd cpd --files ${EXECUTABLE_NAME} --minimum-tokens 50 --language swift --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > cpd-output.xml --failOnViolation true\n\n# Running script\nphp ./cpd_script.php -cpd-xml cpd-output.xml"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/code-quality b/code-quality new file mode 160000 index 0000000..e86a671 --- /dev/null +++ b/code-quality @@ -0,0 +1 @@ +Subproject commit e86a6710e58fc4de1da83b014a11b3a31ff95d9f diff --git a/cpd-output.xml b/cpd-output.xml new file mode 100644 index 0000000..45d60be --- /dev/null +++ b/cpd-output.xml @@ -0,0 +1,2 @@ + + diff --git a/cpd_script.php b/cpd_script.php new file mode 120000 index 0000000..120866c --- /dev/null +++ b/cpd_script.php @@ -0,0 +1 @@ +code-quality/cpd_script.php \ No newline at end of file