chore: Adding formatting, linting and type checking #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds Linting and Formatting with Ruff, and type-checking with Pyright. It also adds some helpers for running these locally via
make
. Similar to SAELens, all CI checks can be run locally withmake check-ci
to ensure CI passes.Some things to note:
# type: ignore
comments to existing type issues rather than trying to fix them unless the fix was very obvious and simple. These can be fixed over time where it makes sense, but probably not a big deal.graphing_utils.py
has some function calls that are broken and I didn't know what the right way to fix them was. I just disabled type-checking on that file with a TODO to fix it later. Someone who knows that file better should take a looktesting_notebooks/main_experiments.py
seems completely broken, importing things that don't exist and referring to config options that don't exist. I didn't try to fix this and instead just disabled linting and type checking for this file.It maybe be good to add a
PULL_REQUEST_TEMPLATE.md
to this repo similar to SAELens that tells contributors to runmake check-ci
before submitting their PR to make sure everything passes, but I didn't add that as it's probably out of scope for this PR.fixes #49