{"id":197,"date":"2008-03-03T07:09:33","date_gmt":"2008-03-03T12:09:33","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2008\/03\/03\/sharing-your-m-lint-settings\/"},"modified":"2016-04-03T15:33:25","modified_gmt":"2016-04-03T19:33:25","slug":"sharing-your-m-lint-settings","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2008\/03\/03\/sharing-your-m-lint-settings\/","title":{"rendered":"Sharing Your M-Lint Settings"},"content":{"rendered":"<p>Writing robust, production quality MATLAB code is a whole lot easier when you use M-Lint. M-Lint inspects your code for problems and also recommends changes that will help improve the performance or maintainability of your code. M-Lint is analogous to the spelling and grammar checkers I so depend on, available in most word processors.<\/p>\n<p>In order to really take advantage of M-Lint, I&#8217;ve found it useful to integrate it into the code review process. So when working on a team project, we use an agreed upon set of M-Lint settings, which are stored on a public drive. Then, each developer points their M-Lint analyzer to those settings, and codes against them.<\/p>\n<p>Finally, when completing a code review, one of the exit requirements is that the MATLAB code must be in a &#8220;green&#8221; state (no errors, no warnings). We do allow warnings to be ignored using <tt>%#ok<\/tt>, though good justification must be provided.<\/p>\n<p>Here&#8217;s how you can set up shared M-Lint settings:<\/p>\n<p><b><i>The person setting up the shared settings should do the following<\/i><\/b><\/p>\n<ol>\n<ol>\n<li>Open the Preferences dialog by going to <i>File -&gt; Preferences&#8230;<\/i> and select M-Lint (you should see the dialog below)<\/li>\n<\/ol>\n<\/ol>\n<div align=\"center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_sharing_your_m-lint_settings\/m-lint_prefs_window.jpg\"><br \/>\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_sharing_your_m-lint_settings\/m-lint_prefs_window_small.jpg\" alt=\"\" border=\"0\" \/><br \/>\n<\/a><\/div>\n<ol>\n<li>Tweak the M-Lint settings as needed<\/li>\n<li>Press <i>Save As&#8230;<\/i><\/li>\n<li>Navigate to a shared directory and press <i>Save<\/i> (alternatively you could check this file into source control)<\/li>\n<\/ol>\n<p><b><i>Each team member should do the following<\/i><\/b><\/p>\n<ol>\n<li>Open the Preferences dialog by going to <i>File -&gt; Preferences&#8230;<\/i> and select M-Lint<\/li>\n<li>Click on the <i>Active Settings<\/i> combo-box and select <i>Browse&#8230;<\/i>\n<div align=\"center\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_sharing_your_m-lint_settings\/active_settings_combo-box.jpg\" alt=\"\" \/><\/div>\n<\/li>\n<li>Navigate to your teams shared M-Lint settings, select that file and click <i>Open<\/i><\/li>\n<li>Press <i>Apply<\/i> or <i>OK<\/i> for the settings to become active.<\/li>\n<\/ol>\n<p>Many of us work on multiple teams, so I should point out that it&#8217;s very easy to switch between M-Lint settings. Go to <i>Tools -&gt; M-Lint<\/i> and select the appropriate settings for the project your working on.<\/p>\n<div align=\"center\"><a href=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_sharing_your_m-lint_settings\/m-lint_tools_menu.jpg\"><br \/>\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/ken_orr_sharing_your_m-lint_settings\/m-lint_tools_menu_small.jpg\" alt=\"\" border=\"0\" \/><br \/>\n<\/a><\/div>\n<p>&nbsp;<\/p>\n<p>I think you&#8217;ll find this approach really makes you think about your warnings, and it will force you to justify any usages of <tt>%#ok<\/tt>.<\/p>\n<p>By the way, there&#8217;s a new blogger in the family. Seth will be talking about Simulink over at his new blog, <a href=\"https:\/\/blogs.mathworks.com\/seth\/\">Seth On Simulink<\/a>. This will be a great place for Simulink users to pick up tips and tricks, as well as share their experiences with the product.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Writing robust, production quality MATLAB code is a whole lot easier when you use M-Lint. M-Lint inspects your code for problems and also recommends changes that will help improve the performance or&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2008\/03\/03\/sharing-your-m-lint-settings\/\">read more >><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,6],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/197"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"predecessor-version":[{"id":3406,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/197\/revisions\/3406"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}