prospector-dev / prospector

Inspects Python source files and provides information about type and location of classes, methods etc
GNU General Public License v2.0
1.95k stars 173 forks source link

[1.8.0 and above] prospector failed to lint on a specific python file #667

Open peterzhuamazon opened 1 month ago

peterzhuamazon commented 1 month ago

When using prospector 1.7.0 and lint this file: https://github.com/opensearch-project/opensearch-build/blob/76a1313c10ecfeb3ee628605ef09cd5c8c526e1a/tests/tests_report_workflow/test_test_report_runner.py

The lint is successful with several issues reported:

prospector --profile ~/.prospector.yaml ./test_report_runner.py
Check Information
=================
         Started: 2024-09-06 19:20:31.653364
        Finished: 2024-09-06 19:20:33.568268
      Time Taken: 1.91 seconds
       Formatter: grouped
        Profiles: ~/.prospector.yaml, no_doc_warnings, no_test_warnings, strictness_high, strictness_veryhigh, no_member_warnings
      Strictness: from profile
  Libraries Used:
       Tools Run: dodgy, mccabe, mypy, profile-validator, pycodestyle, pyflakes, pylint
  Messages Found: 30

However, ever since 1.8.0 version this particular file cannot be lint:

prospector --profile ~/.prospector.yaml ./test_report_runner.py
Check Information
=================
         Started: 2024-09-06 19:20:17.020712
        Finished: 2024-09-06 19:20:17.128526
      Time Taken: 0.11 seconds
       Formatter: grouped
        Profiles: ~/.prospector.yaml, no_doc_warnings, no_test_warnings, strictness_high, strictness_veryhigh, no_member_warnings
      Strictness: from profile
  Libraries Used:
       Tools Run: dodgy, mccabe, mypy, profile-validator, pycodestyle, pyflakes, pylint
  Messages Found: 0

I am so confused of why this is happening, you can clone the repo with that commit I listed above, and try to run the prospector command. Everything seems fail and only pyright (if you enable) would act normally.

Here is profile:


strictness: high
doc-warnings: false
test-warnings: false
autodetect: true
member-warnings: false

pylint:
  disable:
    - W1203
    - W4902
    - R0914
    - C0301
    - C0103
    - W1514

pycodestyle:
  disable:
    - E501

mypy:
  run: true

Thanks.

lucasarruda-ciandt commented 3 weeks ago

I'm on 1.12.0 and the same issue is happening here. It seems all my test files are being ignored (it was not before though). Already tried --test-warnings, no success.