leinardi/pylint-pycharm

Exception with 0.16.3 on Pycharm 2024.2.3

Closed this issue · 4 comments

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: 0.16.3
  • PyCharm/IDEA version: 2024.2.3
  • Pylint version: 3.2.6

Step 3: Describe the problem:

Steps to reproduce:

Run against any Python file.

Observed Results:

image

Expected Results:

No exception

The scan failed due to an exception: Use JsonReader.setLenient(true) to accept malformed JSON at path $ Root cause: Use JsonReader.setLenient(true) to accept malformed JSON at path $ com.squareup.moshi.JsonEncodingException: Use JsonReader.setLenient(true) to accept malformed JSON at path $ 
	at com.squareup.moshi.JsonReader.syntaxError(JsonReader.java:243) 
	at com.squareup.moshi.JsonUtf8Reader.checkLenient(JsonUtf8Reader.java:1152) 
	at com.squareup.moshi.JsonUtf8Reader.doPeek(JsonUtf8Reader.java:384) 
	at com.squareup.moshi.JsonUtf8Reader.peek(JsonUtf8Reader.java:206) 
	at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:38) 
	at com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:58) 
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.scan(PylintRunner.java:280) 
	at com.leinardi.pycharm.pylint.checker.ScanFiles.scan(ScanFiles.java:109) 
	at com.leinardi.pycharm.pylint.checker.ScanFiles.checkFiles(ScanFiles.java:100) 
	at com.leinardi.pycharm.pylint.checker.ScanFiles.call(ScanFiles.java:74) 
	at com.leinardi.pycharm.pylint.checker.ScanFiles.call(ScanFiles.java:46) 
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$2.call(AnyThreadWriteThreadingSupport.kt:162) 
	at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32) 
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) 
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27) 
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) 
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) 
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735) 
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732) 
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) 
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732) 
	at java.base/java.lang.Thread.run(Thread.java:1583)

Hi @quandaica, like I said here I cannot reproduce it on my side, would you be able to provide a reproduction project?

Could you please explain what is a reproduction project? What should I provide?

A reproduction project is essentially a small, simplified example of a project that can demonstrate the issue you're encountering. The idea is to strip away any unnecessary complexity and provide just enough code and configuration to reliably trigger the problem. For example, you could create a basic Python project with one or more files that reproduce the error or warning you are seeing when using the Pylint plugin.

To help me investigate the issue, please include:

  • A pylintrc file (if you're using any custom Pylint configuration)
  • The specific Python file(s) where the error or warning occurs

If you're unsure, even a simple project with one file that triggers a Pylint warning would be enough for me to get started.

Thanks!

my pylintrc file:

[MESSAGES CONTROL]
disable=too-many-lines,too-many-arguments
disable=consider-using-f-string,anomalous-backslash-in-string,broad-exception-caught,missing-module-docstring,invalid-name,missing-function-docstring

I found that this issue is caused by my pylintrc, after remove this file I do not get this exception anymore.