adafruit / Adafruit_Learning_System_Guides

Programs and scripts to display "inline" in Adafruit Learning System guides

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SortImports message hides deeper problems?

jepler opened this issue · comments

I noticed that the Actions logs had lots of messages like

internal error with sending report for module ['Circuit_Playground_Bluefruit_NeoPixel_Controller/Remote_Control.py']
module 'isort' has no attribute 'SortImports'

I investigated how to fix this, and found that isort.SortImports was removed in isort 5.0.0, so I installed an older version (4.3.21) locally, in addition to installing the pinned version of pylint, 1.9.2.

pip install pylint==1.9.2 isort==4.3.21

However, subsequent to doing this there are a LOT of pylint messages, implying that it may have been a long time since pylint actually ran all its checks . For instance,

************* Module MagTag_Smart_Holiday_Lights
MagTag_CircuitPython_Smart_Holiday_Lights/MagTag_Smart_Holiday_Lights.py 2: Unused import digitalio (unused-import)
************* Module clue_hand_wash_timer
CLUE_Hand_Wash_Timer/clue_hand_wash_timer.py 21: Line too long (127/100) (line-too-long)
CLUE_Hand_Wash_Timer/clue_hand_wash_timer.py 27: Line too long (130/100) (line-too-long)

This may not be worth tackling on its own, vs taking the time to upgrade to current pylint.

I think the best way to deal with this is by bumping learn to the same version of pylint we use on libs, holding new guides to the new standard and then over time fixing old guides.

Here's how we do it:

  • Actually switch to 2.7.1 & find out which guides have problem code
  • Fix any low-hanging fruit
  • Add .circuitpython.skip & file an issue for each guide with problems that weren't super simple to resolve

I got about 900 lines of pylint output with 2.7.1, which is actually fewer than I saw with 1.9.2 and fixed isort. However, that's all based on running locally.

I understand concerns about whether we'll ever get around to addressing these issues, but these problems exist whether they're hidden by the old pylint troubles or not.

I'm working on a PR.

Looks like over 100 guides are affected; creating individual PRs may be a bit much.