Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAF9CF10C for ; Tue, 19 Mar 2013 20:23:24 +0000 (UTC) Received: (qmail 57409 invoked by uid 500); 19 Mar 2013 20:23:24 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 57254 invoked by uid 500); 19 Mar 2013 20:23:24 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 57245 invoked by uid 99); 19 Mar 2013 20:23:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Mar 2013 20:23:24 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.67.169.19] (HELO solo.fdn.fr) (80.67.169.19) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Mar 2013 20:23:19 +0000 Received: from lehrin.spaceroots.org (lehrin.spaceroots.org [IPv6:2001:910:10e5:6e78::7e41:1]) by smtp.fdn.fr (Postfix) with ESMTP id C9E3046B94 for ; Tue, 19 Mar 2013 21:22:55 +0100 (CET) Received: from [127.0.0.1] (lehrin.spaceroots.org [127.0.0.1]) by lehrin.spaceroots.org (Postfix) with ESMTP id 34FE15F431 for ; Tue, 19 Mar 2013 21:22:52 +0100 (CET) Message-ID: <5148C91B.8090003@spaceroots.org> Date: Tue, 19 Mar 2013 21:22:51 +0100 From: Luc Maisonobe User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: dev@commons.apache.org Subject: Re: [math] Checkstyle References: <8172D639BA76A14AA5C9DE7E13E0CEBE4DC8DF0968@10.stjude.org> <5148BA21.4020005@free.fr> <5148BFD9.2090602@gmail.com> <5148C135.9030509@gmail.com> In-Reply-To: <5148C135.9030509@gmail.com> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Thomas, Le 19/03/2013 20:49, Thomas Neidhart a �crit : > On 03/19/2013 08:43 PM, Thomas Neidhart wrote: >> On 03/19/2013 08:18 PM, Luc Maisonobe wrote: >>> Hi Jared, >>> >>> Le 19/03/2013 17:14, Becksfort, Jared a �crit : >>>> Hello, >>>> >>>> I am using the Apache Common XML file to format my code submissions >>>> in Eclipse. Gilles says my last submission has some CheckStyle >>>> warnings, so I installed the CheckStyle plugin. It gives tons of >>>> warnings, including some that go against the posted style guidelines, >>>> such as "All public methods must advertise all exceptions they >>>> generate...". It also complains about lines being too wide, but the >>>> XML file configuration does not wrap certain types of lines. There >>>> are lots of others, including spaces following the asterisks in the >>>> javadocs, which surely the autoformatter could handle. >>> >>> The problem you encounter is known. Basically, it is due to the eclipse >>> checkstyle plugin configuration ignoring the checkstyle.xml file. When >>> you ask eclipse to run checkstyle, it uses a completely different >>> default configuration, and of course will raise thousands of warnings. >>> >>> We have set up the appropriate setting for the maven checkstyle plugin >>> (see the pom.xml which specifies that ${basedir}/checkstyle.xml and >>> ${basedir}/license-header.txt should be used). >>> >>> Configuring the eclipse checkstyle plugin is completely different. I >>> tried to make it use the same files, but failed up to now. I will >>> perhaps give it another try later on. >> >> Go to Project Properties | Checkstyle | Local Check Configurations >> >> Create a new Project Relative Configuration, select the checkstyle.xml >> file. Give it a meaningful name. >> >> Click on protect Checkstyle configuration file. Great! >> >> For math this is not necessary, but normally you would need to resolve >> some properties, like location of header template file. I followed your advice, but the plugin complained about the license header file missing. I had to set the checkstyle.header.file additional property to ${basedir}/license-header.txt for the plugin to work correctly. >> >> When you are done, click on the Main tab, and select the newly created >> configuration, otherwise the default one is used which creates lots of >> warnings. >> >> Something that I usually add to the checkstyle.xml: >> >> >> >> As the warnings are otherwise reported as errors, which is annyoing. > > to only check the src/main/java folder, do the following: > > On the Main tab of Checkstyle configuration, disable simple > configuration checkbox, then edit the existing file set, and use a > pattern like this: > > src/main/java/.*\.java Many thanks Thomas, this really helped a lot! Luc > > Thomas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org