Skip to content

Issue #13321: Kill mutation for NewLineAtEnd#13368

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:DTC1
Jul 8, 2023
Merged

Issue #13321: Kill mutation for NewLineAtEnd#13368
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:DTC1

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 6, 2023

Issue #13321: Kill mutation for NewLineAtEnd


check

https://checkstyle.org/checks/misc/newlineatendoffile.html#NewlineAtEndOfFile


Mutation

<mutation unstable="false">
<sourceFile>NewlineAtEndOfFileCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck</mutatedClass>
<mutatedMethod>readAndCheckFile</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to java/io/File::getPath</description>
<lineContent>log(1, MSG_KEY_NO_NEWLINE_EOF, file.getPath());</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>NewlineAtEndOfFileCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck</mutatedClass>
<mutatedMethod>readAndCheckFile</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to java/io/File::getPath</description>
<lineContent>log(1, MSG_KEY_WRONG_ENDING, file.getPath());</lineContent>
</mutation>


Explaination


wrong.line.end=Expected line ending for file is LF(\\n), but CRLF(\\r\\n) is detected.

we are not showing any filepath

Copy link
Copy Markdown
Member

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Member

@Vyom-Yadav Vyom-Yadav left a comment

Choose a reason for hiding this comment

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

LGTM! File path is shown by the CLI for every violation, no need of adding it to the error message.

@Vyom-Yadav Vyom-Yadav assigned romani and unassigned Vyom-Yadav Jul 8, 2023
@Vyom-Yadav Vyom-Yadav requested a review from romani July 8, 2023 07:30
Copy link
Copy Markdown
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.

Ok to merge

@romani romani merged commit 5a61408 into checkstyle:master Jul 8, 2023
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.

4 participants