New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XpathQueryGenerator should consider tabWith parameter #4999

Closed
MEZk opened this Issue Aug 24, 2017 · 2 comments

Comments

@MEZk
Contributor

MEZk commented Aug 24, 2017

XpathQueryGenerator should have tabWith parameter. Default value is 4.

Use case: user specified lineNo = 1 and columnNo = 5 to generate the suppression for file Test.java. Line 1 has 1 tab character. XpathQueryGenerator should calculate the real position of the token to generate suppression xpath as ANTLR parser treats tab characters as one symbol. So if user sees the violation:
1:5: violation message he should be able to pass this values to the generator. The generator should determine the real position of the token.

Algorithm:

  1. tabWith = 4, lineNo = 1, columnNo = 10; realColumnNo = 1;
  2. Read line 1 char by char till columnNo;
  3. If tab is detected, than tabCount++;
  4. Find token with lineNo = 1 and columnNo = 10 - tabWith * tabCount.

@MEZk MEZk moved this from To Do to In Progress in Flexible Suppression Model Aug 24, 2017

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Aug 27, 2017

Contributor

@timurt
Any results?

Contributor

MEZk commented Aug 27, 2017

@timurt
Any results?

timurt added a commit to timurt/checkstyle that referenced this issue Aug 29, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Aug 30, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Aug 30, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Aug 30, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Aug 31, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Sep 2, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Sep 4, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Sep 5, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Sep 5, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Sep 10, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Sep 11, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Sep 17, 2017

romani added a commit that referenced this issue Sep 17, 2017

@romani romani added this to the 8.3 milestone Sep 17, 2017

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Sep 17, 2017

Member

fix is merged.

@MEZk or @timurt , please share in issue description issue number when such generator become available at CLI.

Member

romani commented Sep 17, 2017

fix is merged.

@MEZk or @timurt , please share in issue description issue number when such generator become available at CLI.

@romani romani closed this Sep 17, 2017

@MEZk MEZk moved this from In Progress to Done in Flexible Suppression Model Sep 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment