checkstyle / checkstyle/patch-filters

FUTURE: Combine checkNamesForContextStrategyByTokenOrParentSet and checkNamesForContextStrategyByTokenOrAncestorSet properties

Open
#337 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
4
Forks
11
Avg merge
5h 55m
Merged PRs (30d)
2

Description

`checkNamesForContextStrategyByTokenOrParentSet` and `checkNamesForContextStrategyByTokenOrAncestorSet` do similar thing - they say patch-filter to change AST node to an upper level node for a certain Check, while detecting changed lines in a file.

The second property, checkNamesForContextStrategyByTokenOrAncestorSet, should accept a mapping between a check and AST token type. But instead it uses a hardcoded mapping for certain checks in JavaPatchFilterElement class for now.

**Investigate how we can combine these two properties into one and be able to set a mapping between a check and AST ancestor token type**.
I think it can work this way - if check is defined with no AST token type, then we just take its parent node; if check is defined with AST token type, then we try to find the first ancestor node with this token type.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.