pylint icon indicating copy to clipboard operation
pylint copied to clipboard

[trailing-comma-tuple] Fix enabling with message control locally when disabled for the file

Open Pierre-Sassoulas opened this issue 1 year ago • 14 comments

Type of Changes

Type
:bug: Bug fix

Description

Refs #8606, https://github.com/pylint-dev/pylint/pull/9620 (follow-up) Closes #9608

Pierre-Sassoulas avatar May 07 '24 20:05 Pierre-Sassoulas

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.84%. Comparing base (ce47a62) to head (1eedcbb). Report is 162 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9609   +/-   ##
=======================================
  Coverage   95.84%   95.84%           
=======================================
  Files         174      174           
  Lines       18897    18904    +7     
=======================================
+ Hits        18112    18119    +7     
  Misses        785      785           
Files Coverage Δ
pylint/checkers/refactoring/refactoring_checker.py 98.27% <100.00%> (+<0.01%) :arrow_up:
pylint/lint/message_state_handler.py 96.48% <ø> (ø)

... and 2 files with indirect coverage changes

codecov[bot] avatar May 07 '24 20:05 codecov[bot]

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 6e4525884dd88edf9e89371a471c13f5393eede1

github-actions[bot] avatar May 07 '24 20:05 github-actions[bot]

Jeez, I wonder why ruff don't have fine grained message control yet :smile: (I did not benchmark this yet, I probably need to test some assumptions about the caching of per line enable vs checking the enable on each token).

Pierre-Sassoulas avatar May 07 '24 21:05 Pierre-Sassoulas

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit d1ad751c804c1935791da8eb528a6e46dd27b7c5

github-actions[bot] avatar May 07 '24 21:05 github-actions[bot]

🤖 Effect of this PR on checked open source code: 🤖

Effect on sentry: The following messages are no longer emitted:

  1. trailing-comma-tuple: Disallow trailing comma tuple https://github.com/getsentry/sentry/blob/5cb74afaa7bbd418bb76066326850890c8788a78/src/sentry/management/commands/create_sample_event.py#L10
  2. trailing-comma-tuple: Disallow trailing comma tuple https://github.com/getsentry/sentry/blob/5cb74afaa7bbd418bb76066326850890c8788a78/src/sentry/management/commands/create_sample_event.py#L11
  3. trailing-comma-tuple: Disallow trailing comma tuple https://github.com/getsentry/sentry/blob/5cb74afaa7bbd418bb76066326850890c8788a78/src/sentry/sentry_metrics/consumers/indexer/routing_producer.py#L152

This comment was generated for commit 42eff4362c5c04075457eb95f04ab7c35bd3b716

github-actions[bot] avatar May 08 '24 13:05 github-actions[bot]

Wow, is_message_enabled is seriously misleading. I suggest we rename to is_message_enabled_for_current_file or create an argument for the file which default to current for 3.0 and to None in 4.0, what do you think @DanielNoord ?

Pierre-Sassoulas avatar May 08 '24 14:05 Pierre-Sassoulas

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 0593953e19062b7e6c9c58aae6cf82f7008e80a5

github-actions[bot] avatar May 08 '24 14:05 github-actions[bot]

Hmm, do we know if this actually meaningfully influences performance? Yes calling a function often is bad, but if the effect on performance is negligible than we might not want to overcomplicate our config handling (again).

DanielNoord avatar May 11 '24 08:05 DanielNoord

I was thinking about misleadingness rather than performance. {Number of files} calls is not that problematic, but the function name making me lose 2 hours of debug is :D

Pierre-Sassoulas avatar May 11 '24 10:05 Pierre-Sassoulas

By the way I still don't understand why locally everything work and not in the CI, but I'm short on time atm.

Pierre-Sassoulas avatar May 11 '24 10:05 Pierre-Sassoulas

Does this fix https://github.com/pylint-dev/pylint/issues/8201?

nickdrozd avatar May 11 '24 13:05 nickdrozd

No, maybe a rework is in order but it's not an easy rework to do.

Pierre-Sassoulas avatar May 11 '24 18:05 Pierre-Sassoulas

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 9bc595bb4a413562333e3b241c7881cbe04209df

github-actions[bot] avatar May 13 '24 21:05 github-actions[bot]

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 93a252c20565d25fef810325bcb6c98c1efb98b2

github-actions[bot] avatar May 14 '24 06:05 github-actions[bot]

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit d1e5206fb7dddc4ded1ee111e792b470c570a089

github-actions[bot] avatar May 16 '24 20:05 github-actions[bot]

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 6984f2996eda5aec4b5b06d8e1e6eb6bae6261fd

github-actions[bot] avatar May 16 '24 20:05 github-actions[bot]

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit c088a47555b3e3fb49f5b7d6d45663bfbfa4bead

github-actions[bot] avatar May 17 '24 19:05 github-actions[bot]

Thanks for your work here on this important improvement. I'm wondering what you think about backporting performance improvements. Should we try to keep the patch releases more stable by only backporting bugfixes and not refactors?

jacobtylerwalls avatar May 18 '24 13:05 jacobtylerwalls

Oh woah, I had it backwards. This is the bugfix. Carry on!

jacobtylerwalls avatar May 18 '24 13:05 jacobtylerwalls

I can understand the confusion because I'm trying very hard to optimize the bug fix itself 😄

Pierre-Sassoulas avatar May 18 '24 13:05 Pierre-Sassoulas

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 1eedcbbe534559304d9fc3dbea9752143cf17ec5

github-actions[bot] avatar May 18 '24 14:05 github-actions[bot]