7
Groovy Server Pages(.gsp)で使用できる自動コードレビュー/静的コード解析ツール(CodeNarcなど)はありますか?Groovy Server Pagesの自動コードレビューツール
Groovy Server Pages(.gsp)で使用できる自動コードレビュー/静的コード解析ツール(CodeNarcなど)はありますか?Groovy Server Pagesの自動コードレビューツール
codenarcプラグインを使用して、gspページ/ファイルを確認できます。
は、単にあなたのBuildConfig.groovy
ファイル内
codenarc.processViews = true
を設定すると、彼らはcodenarcチェックに含まれます。ここに含ま
ここで、我々はまた、我々は、オン/オフ含まルールセットのそれぞれから、ルールの部分を回すために使用する外部codenarc.propertiesファイルを定義BuildConfig.groovy
codenarc.processTestUnit = false
codenarc.processTestIntegration = false
codenarc.processViews = true
codenarc.propertiesFile = 'grails-app/conf/codenarc.properties'
codenarc.ruleSetFiles = [
"rulesets/basic.xml",
"rulesets/braces.xml",
"rulesets/grails.xml",
"rulesets/groovyism.xml",
]
に設定codenarc例です。 codenarc.properties
ファイルの例ここに含まれています:
# some gsp's MUST have embedded CSS and/or embedded Javascript which requires the use of semicolons.
UnnecessarySemicolon.doNotApplyToFileNames = *.gsp
# we're not going to enforce these
UnnecessaryGString.enabled = false
UnnecessaryReturnKeyword.enabled = false
希望
トム本当に
ないのに役立ちます。あなたはGSPに実際にたくさんのコードを持つべきではありません.Codenarcはタグライブラリなどでエラーをキャッチします。 –
私はPMDやCheckstyleを試して、何かが得られたかどうかを確認します。 – dmahapatro