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

Diffrent behavoiur with different abs/relative arguments #257

Closed
meteozond opened this issue Jun 9, 2018 · 21 comments
Closed

Diffrent behavoiur with different abs/relative arguments #257

meteozond opened this issue Jun 9, 2018 · 21 comments

Comments

@meteozond
Copy link

It is quite disappointing when overall project, separate file and folder checks give different results. Here is a little table showing results depended on arguments given.

cmd --absolute-path PATH results
not defined Full path to project . file folder
relative abs relative abs code import-error ignored noqa
-* ok
`pwd` - * ok
. - * ok
lib/__init__.py - * ok
`pwd`/lib/__init__.py - * fail *
lib - * fail**
`pwd`/lib - *fail**
--absolute-path +* ok
--absolute-path `pwd` + * ok
--absolute-path . + * ok
--absolute-path lib/__init__.py + * ok
--absolute-path `pwd`/lib/__init__.py + * ok
--absolute-path lib + * fail**
--absolute-path `pwd`/lib + *fail**
@chocoelho
Copy link
Contributor

Hey there, sorry for the delay. I've been quite busy these days due to some personal things but I'm getting back to maintenance here. I'll investigate that this week, prioritizing bugfixes before anything else, but I just want to confirm that this issue is happening using the latest version of prospector. Can you confirm me that?

@meteozond
Copy link
Author

Hi @chocoelho! Thanks for you interest. I've decided to check this case right after 0.12.11 release fixed my previous report #244. Latest update fixed some issues, but unfortunately still affected.

$ pip freeze | grep prospector

prospector==0.12.11
$ prospector --absolute-path `pwd`/lib

Messages
========

...

Check Information
=================
         Started: 2018-06-15 09:41:39.833960
        Finished: 2018-06-15 09:41:46.639318
      Time Taken: 6.81 seconds
       Formatter: grouped
        Profiles: .prospector.yaml, strictness_veryhigh, no_doc_warnings, no_member_warnings
      Strictness: from profile
  Libraries Used: 
       Tools Run: dodgy, mccabe, pep8, profile-validator, pyflakes, pylint
  Messages Found: 21
$ prospector --absolute-path

Check Information
=================
         Started: 2018-06-15 09:51:53.621297
        Finished: 2018-06-15 09:52:40.168239
      Time Taken: 46.55 seconds
       Formatter: grouped
        Profiles: .prospector.yaml, strictness_veryhigh, no_doc_warnings, no_member_warnings
      Strictness: from profile
  Libraries Used: 
       Tools Run: dodgy, mccabe, pep8, profile-validator, pyflakes, pylint
  Messages Found: 0

@pawamoy
Copy link

pawamoy commented Jun 15, 2018

Maybe try deactivating plugins and see if one of them is responsible? I would suggest to start with pylint.

@meteozond
Copy link
Author

@pawamoy, import-error messages are definitely pylint related (at least all of them are pylint reports), but as I see the problem is in prospector provided pylint configuration. Ignored noqa problem is post processing filtering related and it is most likely prospector core problem.

@chocoelho
Copy link
Contributor

The issue is definitely within prospector. I'm taking a look at it right now to find the source of the issue and release a patch ASAP.

@chocoelho
Copy link
Contributor

Just an update: seems like some tools are only running in certain conditions thus the difference of results, and looks like one of these tools is pep8. I'm still investigating the source of the issue with whatever little free time I've got.

@chocoelho
Copy link
Contributor

Another update: I've managed to deal with pep8 not being properly applied, but there's also the issue with pylint return false positives of import-self errors. Again, sorry for taking too long to resolve this issue, but some personal matters are taking too much time from me.

@meteozond
Copy link
Author

meteozond commented Aug 1, 2018

@chocoelho We've checked out new version and looks like most issues gone. But I've found that running check on folder witch submodule depends on upper level module still gives import errors.

- a/
  - __init__.py
  - b.py
      import c
- c.py
  • checking a gives import-error
  • checking b.py doesn't

I'm not sure but it looks like issue is working dir detection dependent when folder check issued.

@Deimos
Copy link

Deimos commented Aug 30, 2018

This issue doesn't seem to be completely resolved. Running a bare prospector from my project's root directory gives no errors found, but if I pass it the name of the subdirectory that includes all the app code, it finds and reports multiple pep8 errors. So it appears that pep8 isn't actually checking that directory normally.

(username mentions in case they won't see this comment on a closed issue otherwise - @chocoelho @carlio)

@chocoelho chocoelho reopened this Aug 30, 2018
@chocoelho
Copy link
Contributor

Due to multiple requests, I'm reopening this issue. Will check that today or tomorrow 🙂

@Deimos
Copy link

Deimos commented Aug 30, 2018

Thanks. My project is open-source if you want to look at the structure or even clone it and try running against it directly. It's here on GitLab and there's a mirror on GitHub too if that's easier. Specifically, running prospector in the root doesn't report issues, but if I run prospector tildes it will report a few pep8 errors from files in the tildes/lib/ directory.

@chocoelho
Copy link
Contributor

@meteozond Sorry for the delay, it's been crazy over here with the coming of my son, so my time has been limited for a while. Checking here, it seems to be related to how we get the minimal path from the found files. In your example, it's taking a into consideration and not the root, although a is not the root. Checking here how to properly fix this minimal path discovery.

@chocoelho
Copy link
Contributor

@Deimos I'm checking here as well, your issue seems more related to how pep8 discovery works, a little bit different from the issue reported but I'm looking into it as I have the time to do so. Sorry for not being able to be more helpful.

@Deimos
Copy link

Deimos commented Oct 5, 2018

It's no problem at all, don't worry about the delay. I appreciate you looking into it whenever you get a chance, thanks.

@chocoelho
Copy link
Contributor

@Deimos @meteozond can you test again with 1.1.5?

@meteozond
Copy link
Author

@chocoelho all of issues from my first message gone, but I've got new one :(

False relative-beyond-top-level pylint detection, for project subfolder check.
I'm going to make proper checks to start new issue later.

@Deimos
Copy link

Deimos commented Nov 20, 2018

@chocoelho Behavior doesn't seem to change for me. For both 1.1.3 and 1.1.5, prospector in the root directory has zero messages, but prospector tildes has pep8 errors.

@chocoelho
Copy link
Contributor

Got it @meteozond @Deimos, will keep on check the reason of these issues

@chocoelho
Copy link
Contributor

@Deimos can you check again?

@Deimos
Copy link

Deimos commented Dec 14, 2018

Yes, the develop branch seems to work as expected now - bare prospector produces the pep8 errors now (same output as prospector tildes). So the issue with my project should be fixed, thanks!

@chocoelho
Copy link
Contributor

Closing this as it's reported as fixed :)

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

No branches or pull requests

4 participants