graphistry / pygraphistry

PyGraphistry is a Python library to quickly load, shape, embed, and explore big graphs with the GPU-accelerated Graphistry visual graph analyzer
BSD 3-Clause "New" or "Revised" License
2.11k stars 205 forks source link

[FEA] replace flake8 with ruff #466

Open lmeyerov opened 1 year ago

lmeyerov commented 1 year ago

Is your feature request related to a problem? Please describe. Less of an impact than replacing mypy... but ruff is pleasantly fast, so let's replace flake8 with it!

prabhjotsingh18 commented 1 year ago

Hey @lmeyerov , I would love to work on this but would need a little guidance. let me know if I can work on this.

lmeyerov commented 1 year ago

Hi @prabhjotsingh18 ! Yes, of course --

prabhjotsingh18 commented 1 year ago

Hey @lmeyerov I was going through the ruff documentation.

the diff from the lint.sh file.

  1. --count is not an option in ruff ( if errors are found the count is displayed at the end )
  2. --show-source and --statistics cannot be used in the same command so wrote 2 different command
    
    ruff check \
        graphistry \
        --select=E9,F63,F7,F82 \
        --statistics

ruff check \ graphistry \ --select=E9,F63,F7,F82 \ --show-source

3. ruff has subset of the Errors implemented so errors  ` E121,E122,E123,E124,E125,E128,E131,E144,E201,E202,E203,E231,E251,E265,E301,E302,E303 ` are not there ( we are ignoring them anyway ) 
4. Wasn’t able to find a way to include max-complexity in the command, but as the max-complexity defaults to 10 didn't need to. 

the output for flake8 and ruff for the same ignore flag ( excluding the above-mentioned flags ) is different. 

we are not ignoring E714 , E713, E402, E741 in both but flake8 is not giving the same output. 

mickysingh@mickysinghs-MacBook-Pro pygraphistry % ruff check \ graphistry \ --exclude graphistry/graph_vector_pb2.py,graphistry/_version.py \ --ignore=C901,E401,E501,E722,F401,W291,W293 \ --line-length=127 \ --statistics 65 E714 [] Test for object identity should be is not 13 E713 [] Test for membership should be not in 10 E402 [ ] Module level import not at top of file 3 E741 [ ] Ambiguous variable name: l mickysingh@mickysinghs-MacBook-Pro pygraphistry % flake8 \ graphistry \ --exclude graphistry/graph_vector_pb2.py,graphistry/_version.py \ --count \ --ignore=C901,E121,E122,E123,E124,E125,E128,E131,E144,E201,E202,E203,E231,E251,E265,E301,E302,E303,E401,E501,E722,F401,W291,W293 \ --max-complexity=10 \ --max-line-length=127 \ --statistics

0

lmeyerov commented 1 year ago

Ah missed this response -- all these seem fine and worth the flip