anybox / pylint_flask_sqlalchemy

pylint_flask_sqlalchemy is a Pylint plugin to improve static code analysis of Flask-SQLAlchemy based projects.
MIT License
8 stars 5 forks source link

Compatibility Issues Due to `astroid` API Changes #18

Open conorcraig opened 4 months ago

conorcraig commented 4 months ago

Description

pylint_flask_sqlalchemy v1.0.0 is incompatible with pylint and astroid v3.1.0, causing TypeError due to missing col_offset, parent, end_lineno, and end_col_offset in ClassDef.

Steps to Reproduce

  1. Install pylint and astroid v3.1.0.
  2. Install pylint_flask_sqlalchemy v1.0.0.
  3. Run pylint on a Flask-SQLAlchemy project.
  4. Observe TypeError.

Expected Behavior

The plugin should work without errors.

Actual Behavior

Errors due to missing parameters in ClassDef.

Possible Fix

Update ClassDef instantiation in the plugin:

node.locals[key] = [ClassDef(key, None, 0, node, end_lineno=None, end_col_offset=None)]

Additional Information

Suggested Labels