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

chore(pylint): Enable useless-suppression check #16388

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Aug 21, 2021

SUMMARY

Enabling one of my all time favorite Pylint checks—useless-suppression. I'm not sure why it's not enabled by default, but it's a great check to ensure the code base includes no unnecessary #pylint: disable=<check> clutter due either to human error or evolving Pylint logic.

The one major caveat is there's a false positive with the line-too-long check (pylint-dev/pylint#4212) which we need to disable on a per line basis.

TESTING INSTRUCTIONS

CI.

ADDITIONAL INFORMATION

  • Has associated issue: [SIP-46] Proposal for strict Pylint enforcement #9953
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Aug 21, 2021

Codecov Report

Merging #16388 (8cd6d2f) into master (3faf653) will decrease coverage by 0.07%.
The diff coverage is 84.21%.

❗ Current head 8cd6d2f differs from pull request most recent head c3ad346. Consider uploading reports for the commit c3ad346 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16388      +/-   ##
==========================================
- Coverage   76.57%   76.49%   -0.08%     
==========================================
  Files        1000     1000              
  Lines       53489    53489              
  Branches     6816     6816              
==========================================
- Hits        40957    40915      -42     
- Misses      12296    12338      +42     
  Partials      236      236              
Flag Coverage Δ
hive ?
mysql ?
postgres 81.55% <84.21%> (ø)
presto 81.38% <83.15%> (?)
python 81.76% <84.21%> (-0.16%) ⬇️
sqlite 81.19% <82.97%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/charts/commands/importers/dispatcher.py 80.64% <ø> (ø)
superset/cli.py 52.85% <0.00%> (ø)
superset/commands/importers/v1/__init__.py 94.73% <ø> (ø)
superset/commands/importers/v1/examples.py 39.53% <ø> (ø)
superset/common/tags.py 0.00% <0.00%> (ø)
superset/dashboards/api.py 93.03% <ø> (ø)
...perset/dashboards/commands/importers/dispatcher.py 83.87% <ø> (ø)
superset/dashboards/commands/importers/v0.py 89.94% <ø> (ø)
superset/dashboards/schemas.py 99.37% <ø> (ø)
...uperset/databases/commands/importers/dispatcher.py 80.64% <ø> (ø)
... and 63 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3faf653...c3ad346. Read the comment docs.

@@ -14,7 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# pylint: disable=R
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-enabling (R)efactor checks.

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with one comment

@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# pylint: disable=C,R,W
# pylint: disable=C,R,W,useless-suppression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we give up on this file?

Copy link
Member Author

@john-bodley john-bodley Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etr2460 no—though it does need a lot of TLC.

I was planning on doing another pass of all files which match git grep "^pylint and remove all top-level disables (except for #pylint: disable=too-many-lines) add add them inline where appropriate.

@john-bodley john-bodley merged commit 7e4c940 into apache:master Aug 23, 2021
@john-bodley john-bodley deleted the john-bodley--pylint-enable-useless-suppression branch August 23, 2021 15:58
This was referenced Aug 23, 2021
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Aug 24, 2021
* master: (582 commits)
  feat: config to customize bootstrap data overrides (apache#16386)
  fix: regex for multi-region IPs (apache#16410)
  chore: Changes the DatabaseSelector to use the new Select component (apache#16334)
  chore: Displays the dataset description in a tooltip in the datasets list (apache#16392)
  fix(pylint): Fix master (apache#16405)
  chore(pylint): Enable useless-suppression check (apache#16388)
  feat: Add extraVolumes and extraVolumeMounts to all main containers (apache#16361)
  initial commit (apache#16366)
  fix: big number default date format (apache#16383)
  initial commit (apache#16380)
  fix: import dashboard w/o metadata (apache#16360)
  test: Functional RTL for email report modal II (apache#16148)
  fix: update table ID in query context on chart import (apache#16374)
  docs: document FLASK_APP_MUTATOR (apache#16286)
  feat: Add new dev commands to Makefile (apache#16327)
  fix: call external metadata endpoint with correct rison object (apache#16369)
  fix: Fix parsing onSaving reports toast when user hasn't saved chart (apache#16330)
  fix: columns/index rebuild (apache#16355)
  chore(viz): bump deckgl plugin to 0.4.11 (apache#16353)
  fix: Blank space in Change dataset modal without warning message (apache#16324)
  ...

# Conflicts:
#	superset/app.py
#	superset/models/dashboard.py
#	tests/integration_tests/charts/filter_sets/__init__.py
#	tests/integration_tests/charts/filter_sets/conftest.py
#	tests/integration_tests/charts/filter_sets/consts.py
#	tests/integration_tests/charts/filter_sets/create_api_tests.py
#	tests/integration_tests/charts/filter_sets/delete_api_tests.py
#	tests/integration_tests/charts/filter_sets/get_api_tests.py
#	tests/integration_tests/charts/filter_sets/update_api_tests.py
#	tests/integration_tests/charts/filter_sets/utils.py
#	tests/integration_tests/superset_test_config.py
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
Co-authored-by: John Bodley <john.bodley@airbnb.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants