{"id":656,"date":"2016-08-23T00:24:18","date_gmt":"2016-08-23T00:24:18","guid":{"rendered":"http:\/\/choudhury.com\/blog\/?p=656"},"modified":"2017-02-23T23:08:29","modified_gmt":"2017-02-23T23:08:29","slug":"enforcing-coding-standards-using-checkstyle","status":"publish","type":"post","link":"https:\/\/choudhury.com\/blog\/2016\/08\/23\/enforcing-coding-standards-using-checkstyle\/","title":{"rendered":"Enforcing Coding Standards using Checkstyle"},"content":{"rendered":"<p><a href=\"http:\/\/checkstyle.sourceforge.net\/\">Checkstyle<\/a> is a great tool for enforcing agreed code style across a team.<\/p>\n<p>To make sure everyone in your team is observing the agreed code style. You can get the checkstyle maven plugin to fail the build if a rule is violated<\/p>\n<p><a href=\"https:\/\/github.com\/muminc\/enforce-checkstyle-example\">Here<\/a> is a simple example demonstration a simple project with checkstyle rules applied. Here is an example of checkstyle failing our build,  we have setup <a href=\"https:\/\/github.com\/muminc\/enforce-checkstyle-example\/blob\/master\/tools-config\/src\/main\/resources\/custom_checks.xml\">checkstyle config<\/a> in this example project to enforce left curly is a line by itself, but as you can see in the example project, the Hello class has violated the rule.<\/p>\n<p> Checkstyle has an an extensive list of checks you can configure and you even write your checks aswell.<\/p>\n<p><a href=\"https:\/\/choudhury.com\/blog\/wp-content\/uploads\/2016\/08\/checkstyle-build-check-goal.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/choudhury.com\/blog\/wp-content\/uploads\/2016\/08\/checkstyle-build-check-goal.gif\" alt=\"checkstyle-build-check-goal\" width=\"979\" height=\"512\" class=\"alignnone size-full wp-image-658\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Checkstyle is a great tool for enforcing agreed code style across a team. To make sure everyone in your team is observing the agreed code style. You can get the checkstyle maven plugin to fail the build if a rule is violated Here is a simple example demonstration a simple project with checkstyle rules applied. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/choudhury.com\/blog\/2016\/08\/23\/enforcing-coding-standards-using-checkstyle\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Enforcing Coding Standards using Checkstyle&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-656","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/posts\/656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/comments?post=656"}],"version-history":[{"count":9,"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions"}],"predecessor-version":[{"id":683,"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions\/683"}],"wp:attachment":[{"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/media?parent=656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/categories?post=656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/choudhury.com\/blog\/wp-json\/wp\/v2\/tags?post=656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}