checkstyle

CheckStyle的安装及使用

若如初见. 提交于 2019-12-05 02:24:29
CheckStyle是SourceForge下的一个项目,提供了一个帮助JAVA开发人员遵守某些编码规范的工具。它能够自动化代码规范检查过程,从而使得开发人员从这项重要,但是枯燥的任务中解脱出来。 下载地址: http://sourceforge.net/projects/eclipse-cs/ 以下是详细的安装步骤 1在官网下载最新版本 打开以上的下载地址,进入下载页面,点击“download”开始插件的下载 以下为解压文件目录:(主要文件为:features、plugins) 2采用link方式安装eclipse插件 选择eclipse图标,右键选择“打开文件位置”,打开eclipse的安装目录。 在该目录下新建文件夹“myplu”,将刚才压缩包中的features、plugins拷贝到myplu目录。 打开eclipse主目录下的dropins文件夹,新建checkstyle.link文件。(扩展名为.link),使用记事本打开该文件,填写刚才的myplu路径,如:path=D://soft//Install//eclipse//myplu 3验证安装是否成功 重新启动eclipse,选择“window”--“preferences”,查看是否存在Checkstyle选择,若存在说明安装成功。如图 4配置Checksytel 选择“window”--“preferences”

JavaScript code checking beyond JSLint [closed]

删除回忆录丶 提交于 2019-12-05 01:53:22
I'm looking for something that works like Checkstyle for JavaScript. I know about JSLint and I'm already using Google's Closure compiler, but these mostly check for syntactic issues. Checkstyle can check for braces on the wrong line, but it also makes it possible to write custom checks like don't use HashMap. I'm looking for something like that for an upcoming JavaScript project. Any ideas? Google Closure Linter: http://code.google.com/closure/utilities/ "The Closure Linter is a utility that checks JavaScript files for style issues such as operator placement, missing semicolons, spacing, the

Checkstyle rules for Google Java Style

佐手、 提交于 2019-12-05 00:57:16
Is there a Checkstyle rule file with the Google Java Style ? The checkstyle team added it several days ago. Here it is : https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml Markus Schulte If you have a maven-project, you can easily integrate google_checks (you have to use at least maven-checkstyle-plugin version 2.17) <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.17</version> <configuration> <configLocation>google_checks.xml</configLocation> </configuration> </plugin> Executing checkstyle

Java - Checkstyle - Redundant Throws

那年仲夏 提交于 2019-12-04 22:20:21
I'm using STS and installed checkstyle plugin. Using install new software with this URL http://eclipse-cs.sourceforge.net/update . I have my own checkstyle rule for my Java project. Whenever I change any code and save it shows the following error for me. Errors occurred during the build. Errors running builder 'Checkstyle Builder' on project 'myproject'. cannot initialize module TreeWalker - Unable to instantiate RedundantThrows cannot initialize module TreeWalker - Unable to instantiate RedundantThrows cannot initialize module TreeWalker - Unable to instantiate RedundantThrows cannot

Is SonarQube Replacement for Checkstyle, PMD, FindBugs?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 07:23:15
问题 We are working on a web project from scratch and are looking at the following static code analysis tools. Conventions (Checkstyle) Bad practices (PMD) Potential bugs (FindBugs) The project is built on Maven. Instead of using multiple tools for the purpose, I was looking at a single flexible solution and came across SonarQube. Is it true that we can achieve the results from Checkstyle, PMD and Findbugs with SonarQube? 回答1: Sonar will run CheckStyle, FindBugs and PMD, as well as a few other

“First sentence should end with a period.”

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 02:54:05
问题 Java checkstyle confuses and baffles me. package pmain; /** * Some text here. */ public class Main { } This is literally all of the code I have. Checkstyle displays a "First sentence should end with a period." at the "/**". Why does CheckStyle produce this warning? Could the checkstyle config I'm required to use be broken? Am I doing something wrong? Is "Some text here" not the first sentence? Is "." not a period? 回答1: The first sentence should end with a dot. /** *An abstract class that

How fix all check style issues with Intellij Idea?

陌路散爱 提交于 2019-12-04 02:17:58
I have an xml configuration file for maven checkstyle plugin. I have installed Intellij Idea plugin and see all checkstyle violation. Is there a way to fix most of them automatically? For example auto formatting setting? Is there a way to setup Intellij Idea to autoformat from checktyle config file? Ajay Yadav There is an option now. checkstyle-IDEA since 4.24.0 features import of checkstyle config. Please install CheckStyle-IDEA plugin ( http://plugins.jetbrains.com/plugin/1065?pr=idea ), it can be found via plug-in repository (Settings|Plugins|Browse repositories). Go to Settings|Editor|Code

eclipse使用link方式安装checkstyle

旧巷老猫 提交于 2019-12-04 01:01:38
什么是checkstyle CheckStyle 是 SourceForge 下的一个项目,提供了一个帮助 JAVA 开发人员遵守某些编码规范的工具。它能够自动化代码规范检查过程,从而使得开发人员从这项重要,但是枯燥的任务中解脱出来。 CheckStyle 检验的主要内容 · Javadoc 注释 ·命名约定 ·标题 · Import 语句 ·体积大小 ·空白 ·修饰符 ·块 ·代码问题 ·类设计 ·混合检查(包活一些有用的比如非必须的 System.out 和 printstackTrace ) 从上面可以看出, CheckStyle 提供了大部分功能都是对于代码规范的检查,而没有提供象 PMD 和 Jalopy 那么多的增强代码质量和修改代码的功能。但是,对于团队开发,尤其是强调代码规范的公司来说,它的功能已经足够强大。 转自 http://www.oschina.net/p/checkstyle/ Eclipse插件安装 1. 明确需要安装的版本 不同的 eclipse ( MyEclipse 是基于 eclipse 进行扩展的)能够安装的插件版本是不同,以下是 checkstyle 对 eclipse 不同版本的支持( checkstyle 最新版为 5.6 ) Checkstyle 发布日期 Eclipse3.1 Eclipse3.2 Eclipse3.3

Generate Checkstyle HTML report with Gradle

Deadly 提交于 2019-12-04 00:21:40
I'd like to get the output of running Checkstyle via Gradle as an HTML report. I've found nothing in the Checkstyle plugin documentation . I've added the following to my build.gradle file. checkstyleTask { reports { html { destination "build/reports/checkstyle.html" } } } but this yielded What went wrong: A problem occurred evaluating root project 'MyProject'. Could not find method checkstyleTask() for arguments [build_1vu33nc0ekgtoo19jt e86o8o42$_run_closure8@1d8ee20] on root project 'MyProject'. Is there a way to generate Checkstyle HTML reports using Gradle? Thanks. JB Nizet Here's how I do

Error while installing check style plugin for eclipse

跟風遠走 提交于 2019-12-03 17:44:09
问题 I am getting the following error while installing the checkstyle plugin for my eclipuse via the update manager Cannot complete the install because one or more required items could not be found. Software being installed: EclipseCS SevNTU plugin feature 1.5.0 (com.github.sevntu.checkstyle.checks.feature.feature.group 1.5.0) Missing requirement: Sevntu eclipse-cs Extension Plugin 1.5.0 (com.github.sevntu.checkstyle.checks 1.5.0) requires 'bundle net.sf.eclipsecs.core 0.0.0' but it could not be