Skip to content
New issue

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

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

Already on GitHub? # to your account

0.48.0使用ktlint --stdin -F 进行格式化,会提示错误 #1742

Closed
xuqigang opened this issue Dec 22, 2022 · 4 comments · Fixed by #1745
Closed

0.48.0使用ktlint --stdin -F 进行格式化,会提示错误 #1742

xuqigang opened this issue Dec 22, 2022 · 4 comments · Fixed by #1745
Milestone

Comments

@xuqigang
Copy link

xuqigang commented Dec 22, 2022

0.48.0执行以下命令
cat "$file_path" |
"$DIR"/ktlint/ktlint --stdin -F

会提示如下错误:
: 1: 1: File 'file.kt' contains a single class and possibly also extension functions for that class and should be named same after that class 'MainActivity.kt' (cannot be auto-corrected) (filename)

Summary error count (descending) by rule:
filename: 1

但是在0.47.0就没有这个问题

@paul-dingemans
Copy link
Collaborator

Please clarify (in english) what you mean and what you expect to happen. I can not help without it.

@xuqigang
Copy link
Author

xuqigang commented Dec 24, 2022

I am a Chinese developer。The 0.48.0 version executes the following command:
cat "$file_path" | "$DIR"/ktlint/ktlint --stdin -F

The following error will be prompted:
: 1: 1: File 'file.kt' contains a single class and possibly also extension functions for that class and should be named same after that class 'MainActivity.kt' (cannot be auto-corrected) (filename) Summary error count (descending) by rule: filename: 1
But in version 0.47.0, there was no such problem.
--stdin , I don't think we should prompt this error.

@xuqigang
Copy link
Author

Please clarify (in english) what you mean and what you expect to happen. I can not help without it.

The 0.48.0 version executes the following command:
cat "$file_path" | "$DIR"/ktlint/ktlint --stdin -F

The following error will be prompted:
: 1: 1: File 'file.kt' contains a single class and possibly also extension functions for that class and should be named same after that class 'MainActivity.kt' (cannot be auto-corrected) (filename) Summary error count (descending) by rule: filename: 1
But in version 0.47.0, there was no such problem

@paul-dingemans
Copy link
Collaborator

See https://pinterest.github.io/ktlint/install/snapshot-build/ if you want to use this functionality before the release of 0.48.1 is published.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants