Maxim Vetrenko - Checkstyle configuration for Google's Java Style guide - phase 2

1,343 views
Skip to first unread message

Макс Ветренко

unread,
Jun 22, 2014, 4:29:09 PM6/22/14
to checksty...@googlegroups.com
Daily: 
1, Update NoLineWrap (1h) 
2. Update xdoc for OneTopLevelClass. Full rewrite OneTopLevelClass. (1.5h)
3. Implement update for DeclarationOrder (1.5h)
4. Investigate and starting to implement WhitespaceAround. (1h) 
5. Read FAQ about mid-term evaluations. (40m) 
6. Investigate UTF8 to prepare implementation Utf8EncodingCheck. (1h)
Total time ~6.5h 

Roman Ivanov

unread,
Jun 23, 2014, 2:53:30 PM6/23/14
to checksty...@googlegroups.com
Hi Max,

>  Total time ~6.5h

I do not see work on testing project, we still behind the plan, why working hours are less then 8h ?

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jun 23, 2014, 7:08:31 PM6/23/14
to checksty...@googlegroups.com
Daily:
1. Send a lot of time at WhitespaceAround Update (4-5h).
2. Testing new Checks, found a false-positive it OneTopLevelClass.(~2h) 
3. Fixed false-positive in OneTopLevelClass (40m), I don't finish it yet, but I can provide a commit. 

Roman Ivanov

unread,
Jun 23, 2014, 11:22:21 PM6/23/14
to checksty...@googlegroups.com
Hi Max,

please put this to you plan for development:
Current Check does not cover all cases, and it is required in Google Style too.

thanks,
Roman Ivanov

Ruslan Diachenko

unread,
Jun 24, 2014, 2:15:24 AM6/24/14
to checksty...@googlegroups.com
Max,

Provide all squashed commits which are ready for review.

Макс Ветренко

unread,
Jun 24, 2014, 3:17:30 PM6/24/14
to checksty...@googlegroups.com

Макс Ветренко

unread,
Jun 24, 2014, 4:12:38 PM6/24/14
to checksty...@googlegroups.com

Ruslan Diachenko

unread,
Jun 24, 2014, 5:03:45 PM6/24/14
to checksty...@googlegroups.com
1. NoLineWrap - reviewed
2. Update for existing Check: WhitespaceAround - reviewed
3. Update for existing Check: DeclarationOrder - reviewed

See my comments in the issues.

Ruslan Diachenko

unread,
Jun 24, 2014, 5:04:59 PM6/24/14
to checksty...@googlegroups.com
Max,

Where is your daily report for Jun 24th ??

Макс Ветренко

unread,
Jun 25, 2014, 1:18:26 PM6/25/14
to checksty...@googlegroups.com

Макс Ветренко

unread,
Jun 25, 2014, 4:35:40 PM6/25/14
to checksty...@googlegroups.com
Daily report. Can't provide temporal expenditures because I don't exatcly how much time have i spend. But it's more then 7 h
1. Prepare commits to next code review. Links porvide above. Please, make code review. Have a two questions https://github.com/maxvetrenko/checkstyle/issues/22https://github.com/maxvetrenko/checkstyle/issues/20 
2. Worked at test project but I have faild. Roman, now, I don't know how to resolve. I'll try tonight again, but I'm not sure about the result. 

Ruslan Diachenko

unread,
Jun 25, 2014, 4:46:54 PM6/25/14
to checksty...@googlegroups.com
Max,

I can't catch you to discuss your questions. Please call me if you're able

Ruslan Diachenko

unread,
Jun 25, 2014, 6:44:30 PM6/25/14
to checksty...@googlegroups.com
1. reviewed
2. reviewed
3. reviewed
4. reviewed
See answers in my new review notes in the issues comments

Ruslan Diachenko

unread,
Jun 25, 2014, 6:52:23 PM6/25/14
to checksty...@googlegroups.com
>> Can't provide temporal expenditures because I don't exatcly how much time have i spend. But it's more then 7 h

I know you can! You've already done it. Please provide at least approximate time for each point you mention in your daily reports

Макс Ветренко

unread,
Jun 26, 2014, 8:29:21 PM6/26/14
to checksty...@googlegroups.com

Макс Ветренко

unread,
Jun 27, 2014, 7:28:59 PM6/27/14
to checksty...@googlegroups.com
Daily:
1. Ready 

    previous commit are ready for code review. Updated JavaDoc, xdocs. fixed checkstyle warnings. 

2. Created UT with run Checkstyle on source files, Take properties from xml file. Commit (>8h) Yes, I really spent a lot of time on it. But now it woks. 

3. Starting work with SeparatorWrap (30m). 

Total time: ~9,5h

Roman Ivanov

unread,
Jun 28, 2014, 1:50:28 AM6/28/14
to checksty...@googlegroups.com
Hi Max and Ruslan,

I marked as confirmed coverage of rule 4.1.3 .
After long discussion with Dima Voytenko , he persuaded me that there is not conflict in requirements, 4.1.3 extend 4.1.1.

Max, you need to update this Check to let force non-empty block only for multi-block sentences. 
So 
If (a==1) {} //is not OK 
If (doSideEffect()==1) {} //is not OK, 
while ((r = in.read()) != 0) {} // is OK 
for (; index < s.length() && s[index] != 'x'; index++) {} // is OK

and 
If (a==1) {} else {print(a)} // is not OK 

Till comments support are not in Checkstyle you can not extend this check to allow empty blocks that have a comments.  
 // it is OK, but you can not support this now
If (a==1) {/*it is ok */} else {print(a)}

thanks,
Roman ivanov

Roman Ivanov

unread,
Jun 28, 2014, 2:44:45 PM6/28/14
to checksty...@googlegroups.com
Max,

1) update wiki for "4.1.3 Empty blocks: may be concise EmptyBlock"
make sure that eclipse do formatting automatically on each Cntl+S
3) uberi "ConfigurationBuilder builder = new ConfigurationBuilder(new File("src/"), "checkstyle_google_style.xml");" v metod @BeforeClass
4) >>> verify(builder.getCheckConfig("FallThrough"), builder.getFilePath("InputFallThrough"), expected);
[07:58:47] RomanIvanov: vynesi v peremennye vse argumenty
5) 
 "14:13: Fall through from previous branch of the switch statement.",
         "38:13: Fall through from previous branch of the switch statement.",
Remove that copy paste, use the same approach as in sevntu-checkstyle project.

thanks,
Roman Ivanov
 

Ruslan Diachenko

unread,
Jun 28, 2014, 3:51:30 PM6/28/14
to checksty...@googlegroups.com
Max,

1. a, b, c, d - reviewed

See my comments in the issues

Макс Ветренко

unread,
Jun 28, 2014, 9:06:43 PM6/28/14
to checksty...@googlegroups.com
Daily:
Ruslan, fix your comments, attached commits look at issues. (1h)

Worked at Separators. Investigated separators, worked at commit (1h)

Worked at testproject. 

Changed project structure (1.5h)

Create and debug CunfigurationBuilder class to collect all methods to work with xml (4h)

Create example test. It works if use String expected messages instead of getCheckMessage. No it throws NPE. Worked at it, tomorrow I'll tried resolve it. (2h)

Roman:
1. Done
2. Has not yet been made
3. Done
4. Done
5. Have an NPE in getCheckMessage, in progress. (all 30m)

Total time: ~10h



Макс Ветренко

unread,
Jun 28, 2014, 9:07:26 PM6/28/14
to checksty...@googlegroups.com
Ruslan, fix your comments, attached commits look at issues
Sorry, >> fixed your comments 

Макс Ветренко

unread,
Jun 29, 2014, 9:34:41 AM6/29/14
to checksty...@googlegroups.com

Ruslan Diachenko

unread,
Jun 29, 2014, 4:53:40 PM6/29/14
to checksty...@googlegroups.com
1 - reviewed, see my notes in the issue
2 - reviewed, see my notes in the issue
3 - reviewed, no more questions. Roman please have a look at it if I missed something.
4 - reviewed, see my notes in the issue

Макс Ветренко

unread,
Jun 29, 2014, 5:35:28 PM6/29/14
to checksty...@googlegroups.com

Макс Ветренко

unread,
Jun 29, 2014, 7:19:26 PM6/29/14
to checksty...@googlegroups.com
Daily:
1. prepare Checks for code review. (30m)
2. New Check SeparatorWrap (1.5h)
3. Working at NPE in this test. Didn't resolve. (4h)

Roman Ivanov

unread,
Jun 30, 2014, 12:52:52 AM6/30/14
to checksty...@googlegroups.com
Hi Max,

> Roman please have a look at it if I missed something.


thanks,
Roman Ivanov

Макс Ветренко

unread,
Jun 30, 2014, 7:32:39 AM6/30/14
to checksty...@googlegroups.com

Макс Ветренко

unread,
Jun 30, 2014, 9:09:45 AM6/30/14
to checksty...@googlegroups.com
Introduce new Check SeparatorWrap. Found and fixed false-positive in following case: s.isEmpty();
Please, make code review. 

Макс Ветренко

unread,
Jun 30, 2014, 11:02:22 AM6/30/14
to checksty...@googlegroups.com
Sorry, after testing on Guava I found false-positive and fixed them. New commit SeparatorWrap

Ruslan Diachenko

unread,
Jun 30, 2014, 12:33:57 PM6/30/14
to checksty...@googlegroups.com

Roman Ivanov

unread,
Jun 30, 2014, 1:10:24 PM6/30/14
to Ruslan Diachenko, checksty...@googlegroups.com
Hi Ruslan and Max,

Roman please have a look at them in case I missed something

I put comments to all issues.

thanks,
Roman Ivanov

Ruslan Diachenko

unread,
Jun 30, 2014, 1:22:32 PM6/30/14
to checksty...@googlegroups.com
Max,

Reviewed, see my comments in the issue

Макс Ветренко

unread,
Jun 30, 2014, 5:25:31 PM6/30/14
to checksty...@googlegroups.com
Dailly:

Roman:

(1h)


New Check: SeparatorWrap. Found bugs, tested on Guava. Check has a 100% coverage. Found bug in ANTLR. 
Grammar can't detect "|" in folowing case:

catch (FooException  | BarException e) {} (4h)

Ruslan I tried to implement another logic, but I could not found another fast and simple solution. 

Roman, I tried to fix NPE in test project, I spent again 3 hours, but I couldn't do it. I need help, I spent a lot of time but solution is still not found. 

Read about UTF8, investigate a bit "isutf8.c" from https://joeyh.name/code/moreutils/ (1h)

Roman Ivanov

unread,
Jun 30, 2014, 9:12:54 PM6/30/14
to checksty...@googlegroups.com
Hi Max,

> 1. , 2. 3.  ..... - 1h

please provide links to issue , in issues pages I expect "Done" on each point that I write to you.
If my comment is last I will not take a look.

> Grammar can't detect "|" in folowing case:

What exactly is working as non expected ? create issue against Checkstyle project ans describe all in details

> Roman, I tried to fix NPE in test project, I spent again 3 hours

Did you discussed that problem with Rulsan on Jun30 ? as I requested.

> Read about UTF8, in
USE GOOGLE TRANSLATOR FOR ALL THAT YOU POST IN MAIL-LIST IN ENGLISH!!!!
Please postpone UTF-8 issue till the very end of GSoC, it is very complicated issue, and it usefulness is minimal and most likely http://jchardet.sourceforge.net/ should be used.

thanks,
Roman Ivanov.

Roman Ivanov

unread,
Jul 1, 2014, 1:40:59 AM7/1/14
to checksty...@googlegroups.com
Hi Max,

> Roman, I tried to fix NPE in test project, I spent again 3 hours

required file is located at
...../checkstyle/target/checkstyle-5.8-SNAPSHOT.jar/com/puppycrawl/tools/checkstyle/checks/coding/messages.properties

so have to loaded as:
pr.load(getClass().getResourceAsStream("/com/puppycrawl/tools/checkstyle/checks/coding/messages.properties"));
or
pr.load(getClass().getClassLoader().getResourceAsStream("com/puppycrawl/tools/checkstyle/checks/coding/messages.properties"));

ATTENTION , Checkstyle have numerous property files!!!! each package have its own file.

in Checkstyle "getClass().getResourceAsStream("messages.properties")" work as XXXXXCheck and property file located in the same package
to make it work you can use:
pr.load(FallThroughCheck.class.getResourceAsStream("messages.properties"));

so to ease development , and have universal load method, you need to specify class of Check, each time, example:
String msg = getCheckMessage(FallThroughCheck.class, "fall.through");

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 1, 2014, 8:57:20 AM7/1/14
to checksty...@googlegroups.com
Roman:

Макс Ветренко

unread,
Jul 1, 2014, 6:39:01 PM7/1/14
to checksty...@googlegroups.com
Daily:
1. I have prepared issues. Make code review please (1h)
2. I have worked with test project. Commit. (5h)
3. I have worked with RightCurlyUpdate. (2h)

Sorry, today I feel bad. Tomorrow I'll work better. 

Roman Ivanov

unread,
Jul 1, 2014, 8:15:37 PM7/1/14
to Макс Ветренко, checksty...@googlegroups.com
Hi Max and Ruslan,

To Ruslan and Amx: I cleared mentors verification signs at
Mentors have to verify implementation and configuration of Checks that cover Google rules. That should be done on final stage of GSoC practice.
Max, if you change config of already verified configuration for particular Check - please leave a comment at wiki, as verification should be done again by mentors.

To Max,

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 2, 2014, 9:45:47 AM7/2/14
to checksty...@googlegroups.com, maxvetr...@gmail.com
1. PR 

Ruslan Diachenko

unread,
Jul 2, 2014, 1:57:30 PM7/2/14
to checksty...@googlegroups.com
Max,

https://github.com/maxvetrenko/checkstyle/issues/10 - reviewed, look at my comment in the issue

Макс Ветренко

unread,
Jul 2, 2014, 3:17:48 PM7/2/14
to checksty...@googlegroups.com
Daily report: 

1. Ruslan:

>> SeparatorWrapCheck is for separators only, so it should contain only separators. We already have one for operators - OperatorWrapCheck. Please update it with missed operators.

Done: commit (1h)

2. Roman:

Your summary:

1. OneTopLevelClass . I corrected Javadoc, but I don't agree with you that we have to remove iterator.
2. NoLineWarp . I corrected Javadoc.

My new update: RightCurly (6h). I spent so much time at Check constantly because there are various Exceptions, especially NPE.

morning update (30m)


Roman Ivanov

unread,
Jul 2, 2014, 8:45:54 PM7/2/14
to Макс Ветренко, checksty...@googlegroups.com
Hi Max,


> To configure the check to force no line-wrapping in package and static statements:

so please provide how to configure it in non default way. Why user need read your code to get to know how to do non standard configuration ?



 I corrected Javadoc, but I don't agree with you that we have to remove iterator.

    public void finishTree(DetailAST aRootAST)
    {
        if (!mPublicTypeFound && iterator.hasNext()) {
            // skip first top-level type.
        mLineNumberTypeMap.remove(mLineNumberTypeMap.firstKey());
        }

        for (Map.Entry<Integer, String> entry : trmap.entrySet()) {
        log(entry.getKey(), "one.top.level.class", entry.getValue());
}

        mLineNumberTypeMap.clear();
        mPublicTypeFound = false;
    }



thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 3, 2014, 10:16:50 AM7/3/14
to checksty...@googlegroups.com, maxvetr...@gmail.com

Ruslan Diachenko

unread,
Jul 3, 2014, 1:02:19 PM7/3/14
to checksty...@googlegroups.com
Max,

https://github.com/maxvetrenko/checkstyle/issues/10 - new notes are waiting for you, please fix them

Макс Ветренко

unread,
Jul 3, 2014, 8:01:05 PM7/3/14
to checksty...@googlegroups.com

Roman Ivanov

unread,
Jul 3, 2014, 8:03:30 PM7/3/14
to Ruslan Diachenko, checksty...@googlegroups.com
Hi Max,

1.

+ * <pre class="body">
+ * &lt;module name=&quot;NoLineWrap&quot;&gt;
+ *     &lt;property name="tokens" value="IMPORT"&gt;
+ * &lt;/module&gt;
+ * </pre>

looks like only imports should be corrected but in example package and import changed.

2. 

        final Iterator<Map.Entry<Integer, String>> iterator =
                mLineNumberTypeMap.entrySet().iterator();

        if (!mPublicTypeFound && iterator.hasNext()) {

Iterator only to calculate size ? what about isEmpty()


thanks,
Roman Ivanov

Ruslan Diachenko

unread,
Jul 4, 2014, 2:23:07 AM7/4/14
to checksty...@googlegroups.com
Max, where is your yesterday's daily report? Please fill in your Google calendar with a "daily report" event and set up reminders. I want to see your reports each day until 9 p.m. (Kiev time). If you don't publish your report until this time it'll mean that you didn't work at all during the day.

Also what is your progress with this issue: https://github.com/maxvetrenko/checkstyle/issues/25 ? You're working on it for a quite long period of time. Did you face some problems?

Ruslan Diachenko

unread,
Jul 4, 2014, 2:40:38 AM7/4/14
to checksty...@googlegroups.com
https://github.com/maxvetrenko/checkstyle/issues/10 - see my notes

On Friday, July 4, 2014 3:01:05 AM UTC+3, Макс Ветренко wrote:
Ruslan: https://github.com/maxvetrenko/checkstyle/issues/10#issuecomment-47811928

Макс Ветренко

unread,
Jul 4, 2014, 7:14:31 AM7/4/14
to checksty...@googlegroups.com, rd....@gmail.com
Roman:

>> looks like only imports should be corrected but in example package 


>>Iterator only to calculate size ? what about isEmpty()


>>I want to see your reports each day until 9 p.m. (Kiev time)

Agreed. I will write a report every day at 9 (Kiev time)

>>Also what is your progress with this issue: https://github.com/maxvetrenko/checkstyle/issues/25 ?

I'll do my best to solve problems today and close this issue. 

Макс Ветренко

unread,
Jul 4, 2014, 9:55:45 AM7/4/14
to checksty...@googlegroups.com, rd....@gmail.com
RightCurlyUpdate is ready for code review. 

Макс Ветренко

unread,
Jul 4, 2014, 12:44:02 PM7/4/14
to checksty...@googlegroups.com, rd....@gmail.com
Skype summary with Roman:

"However, one-character names should be avoided, except for temporary and looping variables.". It's impossible to detect temporary variables. So, we'll detect only looping variables in for loops. 

Макс Ветренко

unread,
Jul 4, 2014, 1:51:47 PM7/4/14
to checksty...@googlegroups.com, rd....@gmail.com
Daily report:
1. RightCurlyUpdate is ready for code review. (3h)
2. Resolving problems with another checks(1h)
3. Worked on the issue Update for existing Check: LocalVariableNameCheck https://github.com/maxvetrenko/checkstyle/issues/23 (2h)

I'll continue the work tonight and try to finish RightCurlyUpdate 


Ruslan Diachenko

unread,
Jul 4, 2014, 2:10:27 PM7/4/14
to checksty...@googlegroups.com, rd....@gmail.com
Max,

Please add your comment to the issue

Ruslan Diachenko

unread,
Jul 4, 2014, 2:29:09 PM7/4/14
to checksty...@googlegroups.com, rd....@gmail.com
Max,

https://github.com/maxvetrenko/checkstyle/issues/10 - another bunch of notes is available

>> RightCurlyUpdate is ready for code review. 

and the next message

>> I'll continue the work tonight and try to finish RightCurlyUpdate 

Where is the truth? Notify me when this check is really ready for review

Roman Ivanov

unread,
Jul 5, 2014, 12:33:13 AM7/5/14
to Ruslan Diachenko, checksty...@googlegroups.com
Hi Max,


ok for PR, attention to my last comment in that issues.

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 5, 2014, 5:28:47 AM7/5/14
to checksty...@googlegroups.com, rd....@gmail.com
Ruslan:

>>Where is the truth? Notify me when this check is really ready for review

My mistake, I meant LocalVariableNameCheck.  RightCurlyUpdate is ready for code review. 


Corrected

Roman:


Done


Have a problem with Travic, but local building succeeds. Don't understand 

Failed tests: testFileWithSecondEnumTopLevelClass(com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheckTest): unexpected output: /home/travis/build/checkstyle/checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/coding/InputDeclarationOrder.java:210: Top-level class Fooable has to reside in its own source file. expected:<1> but was:<2>


Макс Ветренко

unread,
Jul 5, 2014, 8:24:22 AM7/5/14
to checksty...@googlegroups.com, rd....@gmail.com
Daily:
1. Ready: RightCurlyUpdate (1.5h)
2. Ready: LocalVariableNameUpdate (3h)
3. I tried to solve the problem with OneTopLevelClass PR, spent 3 hours, but I did't find answer. Help me

Roman Ivanov

unread,
Jul 5, 2014, 12:34:16 PM7/5/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,


Have a problem with Travic

I reproduced problem in Eclipse, UTs was updated as it had wrong expectations.

thanks,
Roman Ivanov​

Ruslan Diachenko

unread,
Jul 5, 2014, 5:12:03 PM7/5/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
final String text = aRcurly.getText();
final int colNo = aRcurly.getColumnNo();
final int lineNo = aRcurly.getLineNo();
final String currentLine = getLines()[lineNo - 1];

if ((currentLine.substring(0, colNo).trim().length() != 0)
        || currentLine.substring(colNo + text.
                length()).trim().length() != 0)
                
Roman and Max,

I noticed that the aforementioned code and its interpretations are already used in OperatorWrapCheck (and by Max in SeparatorWrapCheck and RightCurlyCheck) checks. It checks whether a token starts the line or finishes the line. Checkstyle already has a method for checking if a token starts the line. For instance:

final boolean startsLine = Utils.whitespaceBefore(rcurly.getColumnNo(), getLines()[rcurly.getLineNo() - 1]);

I looked through the Utils class but it doesn't contain the opposite method for checking if a token finishes the line. I propose to update Utils class with the following method:

public static boolean whitespaceAfter(int aIndex, String aLine)

It will allow us to simplify the logic in our checks and remove copy-paste by playing with both methods.

Roman Ivanov

unread,
Jul 5, 2014, 9:59:29 PM7/5/14
to Ruslan Diachenko, checksty...@googlegroups.com, Макс Ветренко
Hi Ruslan,

Problem of Utils method is that it is in "api" folder.
Extending API should be avoid without big reason. Placing of Utils in API is mistake.
We will move that class out of api one day.

Right now I do not know where to put utils methods common for all Checks.
For now I recommend to keep Checks as independent as possible, even copy-paste is happening.
thanks,
Roman Ivanov

Ruslan Diachenko

unread,
Jul 6, 2014, 7:44:18 AM7/6/14
to checksty...@googlegroups.com, rd....@gmail.com
Max,

1. https://github.com/maxvetrenko/checkstyle/issues/10 - reviewed, see my comments in the issue
2. https://github.com/maxvetrenko/checkstyle/issues/23 - reviewed, see my comments in the issue
3. https://github.com/maxvetrenko/checkstyle/issues/25 - reviewed, see my comments in the issue

Ruslan Diachenko

unread,
Jul 6, 2014, 2:44:19 PM7/6/14
to checksty...@googlegroups.com, rd....@gmail.com
Max,

It seems you did nothing today as I don't see your daily report. Why?

Макс Ветренко

unread,
Jul 7, 2014, 9:44:06 AM7/7/14
to checksty...@googlegroups.com, rd....@gmail.com

>> It seems you did nothing today as I don't see your daily report. Why?

I told you I was in Yalta on Granny's anniversary celebration. Came back very late and could't work at all. 

Макс Ветренко

unread,
Jul 7, 2014, 1:37:02 PM7/7/14
to checksty...@googlegroups.com, rd....@gmail.com
Daily:
Ready for code review (1.5h)

2. Updated Wiki (40m)
4. Updated html report(30m)
5. Working at New Check: EmptyLineSeparatorCheck (4h) 

Макс Ветренко

unread,
Jul 7, 2014, 1:51:25 PM7/7/14
to checksty...@googlegroups.com, rd....@gmail.com
I'll continue my job tonight 

Ruslan Diachenko

unread,
Jul 7, 2014, 4:47:00 PM7/7/14
to checksty...@googlegroups.com, rd....@gmail.com
1. https://github.com/maxvetrenko/checkstyle/issues/10 - no more questions, Roman please have a look
2. https://github.com/maxvetrenko/checkstyle/issues/23 - reviewed, Max see my comments in the issue
3. https://github.com/maxvetrenko/checkstyle/issues/25 - reviewed, Max see my comments in the issue

Roman Ivanov

unread,
Jul 8, 2014, 1:02:48 AM7/8/14
to checksty...@googlegroups.com, rd....@gmail.com
https://github.com/maxvetrenko/checkstyle/issues/10

1) Good code style , no questions :), but :( ...

2) What is a reason of this Check ? It is only for Google's COMMA and DOT rules?
Where are option for user to customize Check?
If no options - rename check to GooglesSeparatorWrapCheck

3) How user can setup its own rules for wrapping , I need  "," to be on next line?

4) 
 if (aAST.getType() == TokenTypes.COMMA) {

Why this Token is so special ? What if I do not care where COMMA is placed in code ?

5) 
* <pre>
* &lt;module name="SeparatorWrap"/&gt;
* </pre>

No comments ..... Please, reply to this thread and describe me what is wrong with that example

6) 
 * A good line wrapping example
 * A bad line wrapping example:

Who told you what is right and what is not ?  Why you do decision without user ?
Style is unique from team to team, there is no standard style - each team decide itself what is good and what is bad.  

Макс Ветренко

unread,
Jul 8, 2014, 6:54:02 PM7/8/14
to checksty...@googlegroups.com, rd....@gmail.com
Daily:
1. https://github.com/maxvetrenko/checkstyle/issues/23- Ruslan, I corrected your notes
2. https://github.com/maxvetrenko/checkstyle/issues/25 - Ruslan, I corrected your notes
3. https://github.com/maxvetrenko/checkstyle/issues/10- Roman, I changed logic, but don't finish JavaDoc.  Please have a look.

Макс Ветренко

unread,
Jul 9, 2014, 9:39:22 AM7/9/14
to checksty...@googlegroups.com, rd....@gmail.com

Макс Ветренко

unread,
Jul 9, 2014, 1:41:06 PM7/9/14
to checksty...@googlegroups.com, rd....@gmail.com
New update was introduced : Update for existing Check: EmptyBlock #27

Макс Ветренко

unread,
Jul 9, 2014, 4:04:23 PM7/9/14
to checksty...@googlegroups.com, rd....@gmail.com
Daliy:
1. I have prepared issues for review.
2. I have introduce new update: Update for existing Check: EmptyBlock #27
3. I have starting work at New Check: EmptyLineSeparatorCheck

Total spent time: 8.5 h

Ruslan Diachenko

unread,
Jul 10, 2014, 2:24:13 AM7/10/14
to checksty...@googlegroups.com, rd....@gmail.com
Max and Roman,


No more questions except the following note: method public int[] getDefaultTokens() is too long and complicated. This leads to different hacks in it. E.g. the one which Max had to do with return:

if (mForceLineBreakAfterClosingBrace && !isOneInTheLine(rcurly))
 +            {
 +                log(rcurly, "line.alone", "}");
 +            }
 +            else {
 +                return;
 +            }
 
I'll create issue in the main Checkstyle project to refactore this check.


I don't like this update. The option mAllowOneCharVarInForLoop looks like a hack to me. What if a user uses one character variables not only in for loops??


No more questions. I'll create another issue for refactoring a copy/paste

Макс Ветренко

unread,
Jul 10, 2014, 7:57:23 AM7/10/14
to checksty...@googlegroups.com, rd....@gmail.com
Ruslan:

>>What if a user uses one character variables not only in for loops??

I think, in this case user can use ^[a-z][a-zA-Z0-9]*$ regexp

Макс Ветренко

unread,
Jul 10, 2014, 8:37:30 AM7/10/14
to checksty...@googlegroups.com, rd....@gmail.com
Ruslan:

>> This leads to different hacks in it. E.g. the one which Max had to do with return:

I tried to fix and I think I got rid of the hack: RightCurlyUpdate

Макс Ветренко

unread,
Jul 10, 2014, 12:00:01 PM7/10/14
to checksty...@googlegroups.com, rd....@gmail.com
I implemented EmptyLineSeparatorCheck for import cases: rule.
But now is not possible to cover this rule This case is incorrect and it's impossible to cover it because Checkstyle can't work with javadoc.

Roman Ivanov

unread,
Jul 10, 2014, 6:15:21 PM7/10/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,

WHERE IS DAILY REPORT ?


But now is not possible to cover this r

JavaDoc, comment it is not a empty line , empty line should be between declarations.

from Rule:
Exception: A blank line between two consecutive fields (having no other code between them) is optional

that could be done by custom suppression of Checkstyle, see http://checkstyle.sourceforge.net/config.html#SuppressionFilter

thanks,
Roman Ivanov

Roman Ivanov

unread,
Jul 10, 2014, 10:55:33 PM7/10/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,


2 Ruslan :

I don't like this update. The option mAllowOneCharVarInForLoop looks like a hack to me. What if a user uses one character variables not only in for loops??

We are going to check variable declaration only in For-loop initialization expression. Max will extend JavaDoc to make all clear. 

​thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 11, 2014, 5:23:59 PM7/11/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
Daily report:

1. https://github.com/maxvetrenko/checkstyle/issues/25 Done. Solved the problem by means of Check, remove bad code (1h)
3. https://github.com/maxvetrenko/checkstyle/issues/27 Done. Solved the problem by means of Check, remove bad code (30h)
4. https://github.com/maxvetrenko/checkstyle/issues/13 Done. New Check was created. (3h). Please, make code review. xdocs will be updated tomorrow. 
6. http://checkstyle.sourceforge.net/config.html#SuppressionFilter Investigated but not fully understood (3h)

Total spent time: ~8.5h

Roman Ivanov

unread,
Jul 12, 2014, 1:43:01 AM7/12/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko

Макс Ветренко

unread,
Jul 12, 2014, 10:20:12 AM7/12/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com

Roman Ivanov

unread,
Jul 12, 2014, 1:01:17 PM7/12/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko

Now working at

where is commit  or ....? 



Please confirm that all "*" at "Applied to config" are all completely done and tested in your project. I and Ruslan need to start validating your configuration.

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 12, 2014, 2:10:16 PM7/12/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
Daily:

2. Worked on the previous fixes (1.5h)

I'll provide one more report in a few hours, because I have to fix my updates and RightCurly PR.

Макс Ветренко

unread,
Jul 12, 2014, 4:29:28 PM7/12/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com

Макс Ветренко

unread,
Jul 13, 2014, 9:23:13 AM7/13/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
Rechecked Wiki. I think it's ready for review. 

Roman Ivanov

unread,
Jul 13, 2014, 10:43:05 AM7/13/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,

1)
Rechecked Wiki. I think it's ready for review.
Please make a "[*]" as a link to line config.
add one more link "tests" to the same table cell - it will open UTest in your test project, to prove that all was tested, and show where we could find how it was tested.

2)
 testproject / src / test / java / com / google / checkstyle / test / chapter2filebasic / rule21filename / Input15ExtensionsTest.java 

 testproject / src / main / java / com / google / checkstyle / test / chapter2filebasic / rule21filename / Input15Extensions.java 

Remove "Input" from JUnit class name - that prefix is only for test files.
Keep number in the middle of name only for package and Name of Junit class to point to rule.
Junit class should be named as Rule21_FilenameExtension.java - and all tests should be in one file.
Input files should be named like Junit file but "Input"  as prefix and "_1", "_2"  as suffix if you want to keep few input files.

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 13, 2014, 11:48:13 AM7/13/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
Hi Roman,


Added boolean - allowIfAllCharactersEscaped. To cover cases like:
return '\ufeff' + content; // byte order mark

I detect all control chars according to http://en.wiktionary.org/wiki/Appendix:Control_characters

Макс Ветренко

unread,
Jul 13, 2014, 5:00:01 PM7/13/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com

Roman Ivanov

unread,
Jul 13, 2014, 7:07:43 PM7/13/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,

please update "RightCurly PR" as Daniil requested.
thanks,
Roman Ivanov

Roman Ivanov

unread,
Jul 14, 2014, 12:37:17 AM7/14/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,


1) You need JavaDoc to explain what you intended to implement

2) Where is formatting ? where spaces between fields ?

3) 
> Regexp Unicode control characters

I do ont understand why you should care about this characters ?

4) update UTs to have the same cases for Char and String. UTs should not care how it is implemented, they cover functionality.

5) I do not see any Inputs where you have multiple characters in string (at the begging, end in the middle , few unicode symbols in middle separated by normal characters ), I do not see how you support this from code.

6) 
from issue:
> I think you can do this with current abilities of Checkstyle, review other checks that work with comments - it is doable

I do not see that implementation


thanks,
Roman Ivanov

Roman Ivanov

unread,
Jul 14, 2014, 12:56:39 AM7/14/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,

Recheck all Checks in config, added links to line config. (3h)


Please do all cells like I did for "2.1 File name".

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 14, 2014, 10:27:55 AM7/14/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com

>> I do ont understand why you should care about this characters ?
According to Google's rule it's a good style to use escapes for non-printable characters, and comment if necessary. Non-printable chars are also called control chars
Options:

boolean - allowIfAllCharactersEscaped. To cover cases like:
return '\ufeff' + content; // byte order mark

this option allow to use 
escapes for non-printable characters. '\ufeff' is only one control char.

Макс Ветренко

unread,
Jul 14, 2014, 12:08:14 PM7/14/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
>> You need JavaDoc to explain what you intended to implement
>> Please do all cells like I did for "2.1 File name".

Wiki. Fixed config links. Testproject links I'll add later. 

Макс Ветренко

unread,
Jul 14, 2014, 4:59:58 PM7/14/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com

>> update UTs to have the same cases for Char and String. UTs should not care how it is implemented, they cover functionality.

Done 

 >>  I do not see any Inputs where you have multiple characters in string

Were created inputs

2. Worked with Wiki

3. Fixed PRs.

Total time: 5h

Макс Ветренко

unread,
Jul 15, 2014, 10:02:00 AM7/15/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com

Макс Ветренко

unread,
Jul 15, 2014, 1:28:37 PM7/15/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
Daily:

1. New Check was implemented  ForbidEscapedUnicodeCharactersCheck.  (3.5h)

2. >>  testproject / src / test / java / com / google / checkstyle / test / chapter2filebasic / rule21filename / Input15ExtensionsTest.java 

 testproject / src / main / java / com / google / checkstyle / test / chapter2filebasic / rule21filename / Input15Extensions.java 

Remove "Input" from JUnit class name - that prefix is only for test files.
Keep number in the middle of name only for package and Name of Junit class to point to rule.
Junit class should be named as Rule21_FilenameExtension.java - and all tests should be in one file.


Was updated testproject (3h)

3. Was updated Wiki. Added links to some tests. (40m)

4. Investigate issue with Indentation Check (1.5h)


Total time: ~9h

Roman Ivanov

unread,
Jul 15, 2014, 11:12:30 PM7/15/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko

> Was updated testproject (3h)
> 3. Was updated Wiki. Added links to some tests. (40m)

update for wiki and testprojects will be mentored by Ruslan, please cooperate with him.
Investigate issue with Indentation Check (1.5h)

I recommend to postpone fixes in this Check for late, as it is not that simple. Lets fix more simple issues.

thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 16, 2014, 10:44:05 AM7/16/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com

Roman Ivanov

unread,
Jul 16, 2014, 1:07:07 PM7/16/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,

after duscussion in Skype do  update at https://github.com/maxvetrenko/checkstyle/issues/14


thanks,
Roman Ivanov

Макс Ветренко

unread,
Jul 16, 2014, 5:32:48 PM7/16/14
to checksty...@googlegroups.com, maxvetr...@gmail.com, rd....@gmail.com
Daily:

Done

2. Prepared PRs 2h)

3. Fixed another problems (1.5)

Total: ~8.5h

Roman Ivanov

unread,
Jul 16, 2014, 9:01:40 PM7/16/14
to Макс Ветренко, checksty...@googlegroups.com, Ruslan Diachenko
Hi Max,​


thanks,
Roman Ivanov
It is loading more messages.
0 new messages