netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.33k stars 2.6k forks source link

Ruff should enforce maximum line length (120 chars) #18022

Closed jeremystretch closed 21 hours ago

jeremystretch commented 1 week ago

Proposed Changes

Configure Ruff to enforce a maximum line length of 120 characters for Python files. This includes:

Justification

NetBox adopted a maximum line length of 120 characters years ago, however it has never been enforced. This will improve linter coverage.

jeremystretch commented 2 days ago

Ruff currently shows ~1098 E501 errors in the feature branch. The biggest offenders currently are the migrations, tests, and urls.py files within each app. The migrations can easily be reformatted with Ruff, and #18023 should address the line length violations from URL paths. We might be able to reformat the tests automatically but these ~273 errors might need to be cleaned up manually.