Skip to content
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

Issue #13809: Kill mutation ConfigurationLoader2 #13900

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

Kevin222004
Copy link
Contributor

Issue #13809: Kill mutation ConfigurationLoader2

Test

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items

@Kevin222004 Kevin222004 force-pushed the ConfigurationLoader2 branch 2 times, most recently from 0c056e1 to 8e5d371 Compare October 25, 2023 09:41
@romani
Copy link
Member

romani commented Oct 26, 2023

Kevin requested help on my comments , we need to help him.

@romani
Copy link
Member

romani commented Oct 29, 2023

your code is correct by it is really hard to understand why this works like this.

lets make test full functional.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE module PUBLIC
    "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
    "https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
    <module name="TreeWalker">
        <module name="MemberName">
            <property name="severity" value="x${severity}"  default="ignore"/>
        </module>
    </module>
</module>
 

load this config as it is done at

public void testResourceLoadConfiguration() throws Exception {

and confirm that property is set to default value.

@romani romani force-pushed the ConfigurationLoader2 branch 2 times, most recently from 12e2e6d to 877fb72 Compare November 5, 2023 14:48
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated code to required state

@romani
Copy link
Member

romani commented Nov 5, 2023

Github, generate website

@romani romani assigned rnveach and unassigned romani Nov 5, 2023
@romani romani requested a review from rnveach November 5, 2023 14:53
@@ -769,4 +769,24 @@ public void testLoadConfiguration3() throws Exception {
.contains("query");
}
}

@Test
public void testDefaultValuesForNonDefinedProperties() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't this test be written in our normal format?

@romani Don't we require javadoc for custom tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whole test class is not using our general format. I still do not feel good to migrate this also to our general for modules format.

Tests are very similar to each other.

@@ -244,6 +244,11 @@
&lt;/module&gt;
</source>

<p>
ATTENTION: default value is applied to module property value if at least one expansion
property is not defined.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is referring to property values with multiple expansions in a single property?

This needs to be expanded. In addition why don't we add an example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not only multiple expansion, any .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about example, but it is not easy to explain and might be too technical, and looks like nobody dealing with this, so we found this nuance only during pitest.

I think we don't need to make our doc to be too much extended and hard to read.

@rnveach rnveach merged commit ab7ac57 into checkstyle:master Nov 7, 2023
113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants