Closed Bug 1541252 Opened 7 months ago Closed 4 months ago

[python3] Fix all errors reported by pylint and flake8

Categories

(Webtools :: Pontoon, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jotes, Assigned: jotes)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

We want to run some of popular linters on the Pontoon codebase to gather issues that require fixing/improvement during the migration to Python 3.

We selected some of the known linters:

  • pylint
  • flake8

(The list is open - feel free to suggest better options).

I'll post a comment If I notice blocking errors which require bigger amount of work.

Assignee: nobody → poke
Status: NEW → ASSIGNED

Pylint (pylint --py3k) reports following errors:

  • round built-in referenced (round-builtin) (13 ocurrences)
  • filter built-in referenced when not iterating (filter-builtin-not-iterating) (5 ocurrences)
  • Implementing __eq__ without also implementing __hash__ (eq-without-hash) (3 ocurrences)
  • map built-in referenced when not iterating (map-builtin-not-iterating) (7 ocurrences)
  • Using an exception object that was bound by an except handler (exception-escape) (7 ocurrences)
  • dict.values referenced when not iterating (dict-values-not-iterating) (4 ocurrences)
  • division w/o __future__ statement (old-division) (11 ocurrences)
  • dict.items referenced when not iterating (dict-items-not-iterating) (1 ocurrences)
  • import missing from __future__ import absolute_import (no-absolute-import) (339 ocurrences)
  • dict.keys referenced when not iterating (dict-keys-not-iterating) (6 ocurrences)
  • __nonzero__ method defined (nonzero-method) (1 ocurrences)

Bumping priority to reflect we're working on this in the current quarter.

Priority: -- → P2
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED

Mmm, given the commit, I shouldn't have closed this. Apologies.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 5 months ago4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.