[SERVER-23312] lint + format Python files Created: 23/Mar/16  Updated: 09/Oct/18  Resolved: 11/Apr/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.7.4

Type: Improvement Priority: Minor - P4
Reporter: Robert Guo (Inactive) Assignee: Jonathan Abrahams
Resolution: Done Votes: 1
Labels: tig-resmoke
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Gantt Dependency
has to be done before SERVER-34030 Format and lint Scons files Closed
Problem/Incident
Related
related to WT-5107 Update WiredTiger Python formatting/l... Backlog
Backwards Compatibility: Fully Compatible
Sprint: TIG 2018-03-26, TIG 2018-04-09, TIG 2018-04-23
Participants:
Linked BF Score: 0

 Description   

we should enforce pep8 or something on the python files.



 Comments   
Comment by Githook User [ 12/Apr/18 ]

Author:

{'email': 'jonathan@mongodb.com', 'name': 'Jonathan Abrahams', 'username': 'hptabster'}

Message: SERVER-23312 Add .mypy_cache to .gitignore
Branch: master
https://github.com/mongodb/mongo/commit/364b712118561bf8483945e8614ba073e64669e3

Comment by Githook User [ 11/Apr/18 ]

Author:

{'email': 'jonathan@mongodb.com', 'name': 'Jonathan Abrahams', 'username': 'hptabster'}

Message: SERVER-23312 Enable Python formatting/linting for buildscripts & pytests files
Branch: master
https://github.com/mongodb/mongo/commit/68005e0ffcc50c9260a162b717aaa5c2225096da

Comment by Githook User [ 11/Apr/18 ]

Author:

{'email': 'jonathan@mongodb.com', 'name': 'Jonathan Abrahams', 'username': 'hptabster'}

Message: SERVER-23312 Fix buildscripts/gdb/mongo_lock.py
Branch: master
https://github.com/mongodb/mongo/commit/b41f62de9f11adfd0074550deda1296c838e2ec9

Comment by Githook User [ 09/Apr/18 ]

Author:

{'email': 'jonathan@mongodb.com', 'name': 'Jonathan Abrahams', 'username': 'hptabster'}

Message: SERVER-23312 Fix packager_enterprise references
Branch: master
https://github.com/mongodb/mongo/commit/c32837da21ec0963773d891c99e92375dadfe6e6

Comment by Githook User [ 09/Apr/18 ]

Author:

{'email': 'jonathan@mongodb.com', 'name': 'Jonathan Abrahams', 'username': 'hptabster'}

Message: SERVER-23312 Fix running buildscripts/lint.py as a script
Branch: master
https://github.com/mongodb/mongo/commit/4500059d1af9cfc732eeb2e78d865e2e9d9d9e95

Comment by Jonathan Abrahams [ 09/Apr/18 ]

The only other file requiring a change in buildscripts is lint.py.

Comment by Max Hirschhorn [ 09/Apr/18 ]

jonathan.abrahams, could you go through the files that were modified in c50c68f and ensure that any scripts in the top level of the buildscripts/ directory (i.e. those with an __main__) are able to be run as stand-alone scripts still. The changes from 8503e64 were necessary to make the Python imports work again by modifying sys.path after import utils had been changed to from buildscripts import utils. spencer had reported a likely similar case with buildscripts/lint.py to me over Slack.

Comment by Githook User [ 05/Apr/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-23312 Fix issue with evergreen_run_tests.py stopping early.

Returning true from _execute_suite() causes resmoke.py to interpret that
the test suite's execution was interrupted by the user and for
subsequent test suites to not be run.
Branch: master
https://github.com/mongodb/mongo/commit/265a38952f11a5d9a6144a22f10dc59b138e0b69

Comment by Githook User [ 05/Apr/18 ]

Author:

{'email': 'max.hirschhorn@mongodb.com', 'name': 'Max Hirschhorn', 'username': 'visemet'}

Message: SERVER-23312 Fix running errorcodes.py as a script.
Branch: master
https://github.com/mongodb/mongo/commit/8503e64f2609370217e6a13b8295daf9e3cfa469

Comment by Githook User [ 05/Apr/18 ]

Author:

{'email': 'jonathan@mongodb.com', 'name': 'Jonathan Abrahams', 'username': 'hptabster'}

Message: SERVER-23312 Python linting - Lint using pylint, pydocstyle & mypy
Branch: master
https://github.com/mongodb/mongo/commit/c50c68fef179d9306f1a3432f48985bf20555e38

Comment by Githook User [ 26/Mar/18 ]

Author:

{'email': 'jonathan@mongodb.com', 'name': 'Jonathan Abrahams', 'username': 'hptabster'}

Message: SERVER-23312 Format Python files with yapf
Branch: master
https://github.com/mongodb/mongo/commit/36148ad8bbdb94162b2926f4700d935ee4dc5994

Comment by Jonathan Abrahams [ 15/Mar/18 ]

We'll need to upgrade mypy from 0.501 to 0.570.

Comment by Max Hirschhorn [ 07/Mar/18 ]

We should extend to the work that Mark did with pylinters.py to encompass the contents of the buildscripts/ and pytests/ directories. The Platforms team has also requested we do Python linting + formatting on the SConstruct and SConscript files.

Comment by Bernie Hackett [ 23/Mar/16 ]

+1. I highly recommend pylint. It also complains about pep8 violations.

Generated at Thu Feb 08 04:03:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.