readthedocs / common

Shared bits around multiple repositories
MIT License
22 stars 38 forks source link

pre-commit: update our dependencies #179

Closed humitos closed 1 year ago

humitos commented 1 year ago

I had to deal with PYTHONPATH again and also with DJANGO_SETTINGS_MODULE this time. Mainly, I did this work because my PR at https://github.com/readthedocs/readthedocs.org/pull/10355 is failing and it doesn't make sense.

This fixed my issue locally and I hope it fixes the issue on CircleCI as well. Let's see.

humitos commented 1 year ago

This fixed my issue locally and I hope it fixes the issue on CircleCI as well. Let's see.

It seems it worked on CircleCI as well! 💪🏼

benjaoming commented 1 year ago

Getting a lot of this

readthedocs/api/v2/views/integrations.py
  Line: 97
    pylint: raise-missing-from / Consider explicitly re-raising using 'except Exception as exc' and 'raise NotFound('Project not found') from exc' (col 12)
  Line: 364
    pylint: raise-missing-from / Consider explicitly re-raising using 'raise ParseError(f'Invalid payload. {key} is required.') from e' (col 12)
  Line: 500
    pylint: raise-missing-from / Consider explicitly re-raising using 'except KeyError as exc' and 'raise ParseError('Parameter "ref" is required') from exc' (col 16)
  Line: 580
    pylint: raise-missing-from / Consider explicitly re-raising using 'raise ParseError(f'Invalid payload. {key} is required.') from e' (col 12)
  Line: 624
    pylint: raise-missing-from / Consider explicitly re-raising using 'except KeyError as exc' and 'raise ParseError('Parameter "ref" is required') from exc' (col 16)
  Line: 726
    pylint: raise-missing-from / Consider explicitly re-raising using 'except KeyError as exc' and 'raise ParseError('Invalid request') from exc' (col 16)
  Line: 809
    pylint: raise-missing-from / Consider explicitly re-raising using 'except TypeError as exc' and 'raise ParseError('Invalid request') from exc' (col 12)

Will just fix this, but I think we should consider linting the entire codebase some day so we don't get all this sudden ad-hoc work in unrelated code.

humitos commented 1 year ago

Just a note. I got the same and I've using exc for the original exception. If we can keep consistency here, is better.

benjaoming commented 1 year ago

I use exc too. But some old places were using e and I didn't change them :)