Hi, Petr!

The idea sounds good in theory, but reality is bit complicated.

When the code is generated from scratch, it's seems possible to comply
with all requirements and checks. But in case of templating there is no 
chance to avoid all violations.

Here is an example:

public AstNode createCustomNode(ParserPos pos, String token) {
    return <placeholder to replace with custom node creation>
}

The code of creation of a custom node may use the pos variable or may not, 
but template should consider both cases.

Besides, the template of SQL parser is out of our control now. Of course we 
could copy this to our codebase, but then we need to update this every time 
we update Calcite version, that I would prefer to avoid.

To sum up: personally I consider the check for generated code is good thing, 
but some exceptions should be possible.

-- 
Regards,
Konstantin Orlov




> On 26 Jul 2021, at 16:09, Petr Ivanov <mr.wei...@gmail.com> wrote:
> 
> Hi, Igniters!
> 
> 
> While working with Semyon on IGNITE-15182 [1] we've stumbled upon the 
> following dilemma, that I would like to discuss.
> 
> Currently, `mvn compile pmd:check` command (as mentioned in Devnotes) also 
> adds to check generated sources and fails on them, while mvn install && mvn 
> pmd:check (as it is done in TC) does not (the reason is in absence of 
> execution of maven-compiler-plugin which is not called on `pmd:check` goal).
> PR from [1] introduces solution to add generated and other sources to check, 
> but now there is a question: should we really add additional sources for 
> examination?
> From one side generated sources are not in our direct control and it can be 
> hard to impossible to fix them right, from another — generated sources still 
> a part of project and some flaws and worst practices in it can influent 
> project's stability in an unpredictable way.
> 
> Please, share your thoughts on the matter!
> 
> 
> 
> 
> [1] https://issues.apache.org/jira/browse/IGNITE-15182
> 

Reply via email to