<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mano on Medium]]></title>
        <description><![CDATA[Stories by Mano on Medium]]></description>
        <link>https://medium.com/@manoyahavan?source=rss-15e07972f400------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9C-ySujk9hZKvlVPrL0PvA.png</url>
            <title>Stories by Mano on Medium</title>
            <link>https://medium.com/@manoyahavan?source=rss-15e07972f400------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 04:13:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manoyahavan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating SwiftLint with Xcode using Pod]]></title>
            <link>https://manoyahavan.medium.com/integrating-swiftlint-with-xcode-using-pod-59a8b142ffc1?source=rss-15e07972f400------2</link>
            <guid isPermaLink="false">https://medium.com/p/59a8b142ffc1</guid>
            <dc:creator><![CDATA[Mano]]></dc:creator>
            <pubDate>Tue, 28 Sep 2021 06:49:05 GMT</pubDate>
            <atom:updated>2021-09-28T06:49:05.237Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1E3jzJgFulgpjL0vjqwyg.png" /></figure><p><strong><em>Introduction</em></strong><br>Sometimes it is tough to maintain the consistent codebase within a small or large team of developers, there will be different conventions and styles will be used across all the developers, so it will be tough to examine/understand the code for new developers or even to some experienced developers.</p><p>To avoid this difficult and to keep our codebase clean and neat <strong>SWIFTLINT</strong> tool is very useful.</p><h3><strong>1. Installation</strong></h3><p>To start with the installation, add the following code in your pod file.</p><blockquote>pod ‘SwiftLint’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*-cXb7Z7605cRQN5snKKXPQ.png" /></figure><h3><strong>2. Integrating SwiftLint with Xcode</strong></h3><p>In order to get warnings and errors in Xcode, add the below code in run Scripts (Project Target -&gt; BuildPhases -&gt; Run Script),</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lbxfXWCPATlPI8K04SJNQ.png" /></figure><blockquote>“${PODS_ROOT}/SwiftLint/swiftlint”</blockquote><p>For Reference, check the below image</p><p>If you don’t find the Run Script option in build phases, refer the below image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Il3ajT_UWiFDS8FdlMVVQ.png" /></figure><h3><strong>3. Testing Your Project with SwiftLint</strong></h3><p>In order to test the SwiftLint Integration with Xcode build your project, it will show the list of warning and errors based on the pre-defined rules on SwiftLint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AHXUzYNgyrkcwU_ORIpWCw.png" /></figure><p>Clear all the warning and errors. If you don’t want to change some codes, you can also reconfigure the rules based on your requirement.</p><p>To do so, you have to create a <strong>.swiftlint.yml</strong> file on your project and add the rules, here are some examples</p><blockquote>included:<br> — (Your Project Path)/(FileName/FolderName))</blockquote><blockquote>excluded:<br> — Pods</blockquote><blockquote>line_length:<br> warning: 500 # warning<br> error: 750 # error</blockquote><blockquote>file_length:<br> warning: 500<br> error: 750</blockquote><blockquote>disabled_rules:<br> — colon<br> — comma<br> — force_cast<br> — force_try</blockquote><blockquote>opt_in_rules:<br> — empty_string</blockquote><blockquote>function_body_length:<br> warning: 250 # warning<br> error: 500 # error</blockquote><blockquote>type_body_length:<br> warning: 500 # warning<br> error: 750 # error</blockquote><blockquote>large_tuple:<br> warning: 4 # warning<br> error: 5 # error</blockquote><blockquote>cyclomatic_complexity: 20</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yDm9P-g-GXHZuwp09pYdg.png" /></figure><p>After adding the rules save and build your project, you can able to see the warning and errors are formed based on your configuration you have mention on <strong>.swiftlint.yml</strong> file.</p><p><strong>4. Additional Info</strong></p><p>To view the more no of rules, use the below command in your terminal</p><blockquote>./pods/swiftlint/swiftlint rules</blockquote><p>And also you can refer <a href="https://realm.github.io/SwiftLint/rule-directory.html">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59a8b142ffc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SonarQube Integration on macOS (Swift & Objective-C) — Developer Edition]]></title>
            <link>https://manoyahavan.medium.com/sonarqube-integration-in-ios-swift-objective-c-developer-edition-9fa5d4bf4e37?source=rss-15e07972f400------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fa5d4bf4e37</guid>
            <dc:creator><![CDATA[Mano]]></dc:creator>
            <pubDate>Mon, 27 Sep 2021 07:35:52 GMT</pubDate>
            <atom:updated>2021-09-30T05:23:48.889Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Zg_VVfuLhC7DhvdfLEfxA.png" /></figure><h3>SonarQube integration on macOS (Swift &amp; Objective-C) - Developer Edition</h3><h3><strong>What is SonarQube?</strong></h3><p>SonarQube is Static Code Analysis tool used for continuous inspection of code quality to perform automatic reviews with a set of rules to detect <a href="https://www.techopedia.com/definition/3758/bug">bugs</a>, <a href="https://en.wikipedia.org/wiki/Code_smell">code smells</a>, and <a href="https://owasp.org/www-community/vulnerabilities/">security vulnerabilities</a>.</p><h3>Prerequisites</h3><p>Make sure your mac have java environment setup (System Preference&gt;Java). If Not kindly <a href="https://www.oracle.com/java/technologies/downloads/">install</a> the JDK or JRE, the Current version (9.1) SonarQube Server and Scanners requires JDK 11 or JRE 11.</p><h3>Installation Process</h3><ol><li>Download the SonarQube Zip File from <a href="https://www.sonarqube.org/downloads/">SonarQube</a> and unZip it. (Make Sure you download the developer edition by <a href="https://www.sonarqube.org/trial-request/developer-edition/">signing-up</a> for 14 day Trail Period, because for analysing Objective-C and Swift developer edition is needed. After the Signup SonarQube team will contact and get some of the details (lines of code, which type of edition needed, etc..), meanwhile proceed with the installation process)</li><li>Start the SonarQube server using terminal by executing the command <strong>(your Downloaded Path)/sonarqube-9.1.0.47736/bin/macosx-universal-64/sonar.sh console</strong></li><li>Once installed successfully, check the server by login on to <a href="http://localhost:9000/">http://localhost:9000</a> in browser by using the admin credentials (Username: admin / Password: admin). It will move on to force password change</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VgrRyUMjdvsOUgH9" /><figcaption>Login Page</figcaption></figure><p>4. Share your serverID information (Administration-&gt;System) to the SonarQube Team for processing the developer edition trail period (14 days only). They will be sending the key for processing the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZja0LWKwO4hliziNY4VGQ.png" /></figure><h3><strong>Creating New Project</strong></h3><p>Steps For creating a new Project in SonarQube</p><ol><li>Click -&gt; Create a new project button.</li><li>Provide -&gt; Project key and a Display name and click the Setup button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vr2F8aur5dEMnzZKer0oCA.png" /></figure><p>3. Select the Repository that need to be analysed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbuBHiG8sf0K_IYhhVWrdQ.png" /></figure><p>4. Give your token a name, click the Generate button, and click Continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FVsHXz_FTVzhAg_C5WRXwg.png" /></figure><p>5. Select your project’s main language under <strong>Run analysis on your project</strong>, and Operating System. Download Sonar Scanner commands to execute a Scanner on your code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1XcUMzoS0zdQu4cqHGF-6Q.png" /></figure><h3><strong>Sonar Scanner</strong></h3><p>Sonar Scanner is the separate client type application that in connection with the SonarQube server, will run project analysis and then send the results to the SonarQube server to process it.</p><ul><li>Download the <a href="https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/">Sonar-Scanner for mac-os</a></li><li>Unzip it and move it to the project directory</li><li>To verify the sonar scanner execute the command, <strong>**(local Directory)/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner -h</strong></li></ul><h3>Configuring your project</h3><p>Add a new file with name sonar-project.properties in your project directory and add the below code in that file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_OquBd5WQ5NNHXwh1cNULA.png" /></figure><p>If there is a need for exclusion of a file or folder add the below command in .properties file (sonar.exclusions=**/*.swift,**/*.h,**/*.m (** represent the folder path, * represent the file name))</p><h3><strong>Running The Sonar Scanner From Terminal</strong></h3><p>Execute the Sonar Scanner commands which you have <a href="https://cdn-images-1.medium.com/max/1600/1*1XcUMzoS0zdQu4cqHGF-6Q.png">downloaded earlier from the SonarQube server</a> in terminal, from the project base directory to launch the analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lb26jV-1A9IFLulFZhRCFw.png" /></figure><p>if need add some additional parameters like, -Dproject.settings=(** local project path)/sonar-project.properties (for getting the project config)</p><p>After the successful completion, Log in to SonarQube to view scan results, by selecting the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ysop7tgD1RNFq5kX69SHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ySGJZKna61w6S891ZF9qw.png" /></figure><h3>Scanning ObjectiveC Projects</h3><p>Scanning projects that contain ObjectiveC code requires some additional analysis steps.</p><ul><li><a href="http://localhost:9000/static/cpp/build-wrapper-macosx-x86.zip">Download</a> Build Wrapper for macOS</li><li>Unzip the wrapper and add it in your project path.</li><li>Execute the below command in terminal, build_wrapper_output_directory refers to your local project path.</li></ul><blockquote>build-wrapper-macosx-x86 — out-dir build_wrapper_output_directory xcodebuild clean build</blockquote><ul><li>After the execution of above command <strong>build-wrapper-dump.json </strong>will be created in your project path</li><li>Add the following code in sonar-project.properties file,</li></ul><pre>sonar.cfamily.compile-commands=(** local project path)/build-wrapper-dump.json</pre><blockquote>Else you can directly add the below command while executing the sonar-scanner (-Dsonar.cfamily.build-wrapper output=build_wrapper_output_directory)</blockquote><h3><strong>Additional Info</strong></h3><ol><li>For more Parameters to be added in .properties file refer <a href="https://docs.sonarqube.org/latest/analysis/analysis-parameters/">https://docs.sonarqube.org/latest/analysis/analysis-parameters/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fa5d4bf4e37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>