-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add support for package and module in Pylint #100
Add support for package and module in Pylint #100
Conversation
.hasCategory("W0611") | ||
.hasSeverity(Severity.WARNING_NORMAL) | ||
.hasModuleName("module_name_no_package") | ||
.hasPackageName(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific test fails and I have absolutely no idea why. If anyone have ideas, I'm all ear 👂
I'm not a Java developer, so I might be missing something obvious...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null
is not possible. Seems that the parser returns the module name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null
is not allowed, use "-"
PS: I still have to check with other tools than Pylint if what I did is consistent. |
} | ||
builder.setModuleName(moduleName); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you need:
else {
builder.setPackageName("-").setModuleName("-");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The builder is not cleared between warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaa, that confirms what I was seeing, effectively. I had the impression something wasn't cleared, but didn't knew what it was. I'll adjust this, thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
.hasCategory("W0611") | ||
.hasSeverity(Severity.WARNING_NORMAL) | ||
.hasModuleName("module_name_no_package") | ||
.hasPackageName(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null
is not allowed, use "-"
01294c3
to
6c12eb1
Compare
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
============================================
+ Coverage 86.45% 86.48% +0.02%
- Complexity 1190 1192 +2
============================================
Files 159 159
Lines 3832 3840 +8
Branches 426 428 +2
============================================
+ Hits 3313 3321 +8
Misses 357 357
Partials 162 162
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
============================================
+ Coverage 86.45% 86.48% +0.02%
- Complexity 1190 1192 +2
============================================
Files 159 159
Lines 3832 3840 +8
Branches 426 428 +2
============================================
+ Hits 3313 3321 +8
Misses 357 357
Partials 162 162
Continue to review full report at Codecov.
|
d30d72b
to
38f0909
Compare
Add support for package and module in Pylint.
In python, a project can look like:
So if a file named
__init__.py
exists in a folder, python will consider that folder as a package (or sub-package, but it's the same as a package, so no big difference). And any file that ends in.py
is called a module.Since warnings-ng supports package and module, I decided to also add support for them in the pylint parser.