SFDO-Tooling / CumulusCI

Python framework for building portable automation for Salesforce projects
http://cumulusci.readthedocs.io
BSD 3-Clause "New" or "Revised" License
363 stars 242 forks source link

Update pyright configuration for 1.1.339 #3715

Closed jstvz closed 11 months ago

jstvz commented 11 months ago

Pyright changed the default typechecking level from 'basic' to 'standard' in v1.1.339. We don't have time to fix these right now, so this commit explicitly declares our typeCheckingMode to 'basic' until we do.

Also, our pre-commit configuration for pyright needs to be improved. First, pyright can't see find our imports because pre-commit installs hooks in their own environments. We could:

  1. Fix our local pre-commit hook so it uses the global environment,
  2. Install our dependencies into the hook environment,
  3. Ignore missing imports until we do (1) or (2).

This commit chooses (3).

Second, using a local hook for Pyright results in inconsistencies in the version used across different environments (local development vs CI). Although an official hook is not available, 'python-pyright' was considered. However, it presents similar challenges in module detection.