Hi Torsten,
On 19 mars 22:15, Torsten Marek wrote:
> A collection of bugfixes and new warnings. No large changesets, the most
> interesting one is definitely warning_scopes.diff.
nice series anyway. I've taken a look at it, do some minor modification. See
comments below. All have my blessing, though I've pushed them all to our
review process anyway so others have the opportunity to do some remark, catch
typos and all. I'll probably handle remarks if any by myself.
> >> bad_str_strip.diff
> Warn about suspicious arguments in {bytes,str,unicode}.{l,r,}strip calls.
>
> Closes #74013
pushed after a slight modification: merged your checker with former
string_format,
renamed for the occasion into 'string' so the message is now E1310 instead of
W1400,
14 being occupied by the string_constant checker and casted to an Error as even
if
it won't cause a crash, it's definitly something that should be fixed.
I've also moved this string_constant from format.py to the renamed as well
strings.py
module. IMO we could also unify checker number and message here, but I have not
bothered with that yet as it may break configurations.
> >> dangerous_default_values.diff
> Unify handling for dangerous default values and make sure that set, dict
> and list literals
> are treated the same way as list(), set() and dict().
>
> (depends on correct set literal inference in logilab.astng)
pushed once added dependency to the targeted astng version in __pkginfo__ and
debian/control.
> >> duplicate_argname.diff
> Warn about duplicate argument names. Python raises a SyntaxError, but it's
> not
> raised during the actual parsing, but in pass 2 (before bytecode
> compilation).
>
> Closes #123233
pushed.
> >> e1124_message.diff
> Improve the warning message for E1124[redundant-keyword-arg].
pushed.
> >> fix_typo_get_msg_display_string.diff
> Fix a wrong variable in get_msg_display_string.
already fixed.
> >> warning_scopes.diff
> Make sure that pragmas that apply to whole lines are interpreted literally,
> so that
> their scope is not extended to the whole scope if they occur at the
> beginning of a
> scope.
Good catch, good fix, pushed :)
> >> yield_in_lambda.diff
> Lambdas can contain yields, do not warn about them.
>
> Closes #123259
pushed
> >> loop_break.diff
> Emit a warning for loops that have an else clause but no break or return.
>
> Closes #81378
I would vote to kill the special case for return which is IMO highly arguable.
I feel like the rule should be the same for all, and if one feel like it's
more readable with the else clause anyway, he should add the pragma to allow
it explicitly .
Also, I would vote for using a Warning rather than a Convention.
Side note for the future: I've renamed newly introduced test files to use the
message name rather than the message id, has it's more readable and less subject
to change.
Thanks again, and hopefuly see you soon!
Cheers,
--
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
CubicWeb, the semantic web framework: http://www.cubicweb.org
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects