Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a mypy-esque cache to Ratter #13

Open
11 tasks done
BPHarris opened this issue Jan 11, 2022 · 0 comments
Open
11 tasks done

Add a mypy-esque cache to Ratter #13

BPHarris opened this issue Jan 11, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@BPHarris
Copy link
Collaborator

BPHarris commented Jan 11, 2022

What

Ratter should cache it's IR for each Python source file to a JSON file, this cache should be invalidated if-and-when the source file's hash or the Ratter version changes, and when the file "passes" analysis.

This is distinct from the existing results cache created via --cache.

Cache Location

For a source file /path/to/dir/source.py, the cache should be stored in /path/to/dir/.ratter/cache/source.json.

Todo

This will require:

  • Versioning info in Ratter
  • Update the existing results cache (i.e. --cache, now --save-results) to also invalidate on version
  • A decided, consistent structure to the cache (i.e. where the cache should be in relation to the source file)
  • Prioritise reading the cache before processing again (prioritisation should be memory, cache, newly process)
  • Tests
  • Security notice on pickle/jsonpickle (+ info in --no-cache CLI arg)

Finally, the following changes must then be made:

  • Update CLI #15
    • --cache should become --save-results
    • --no-cache to not use IR cache
    • --force-refresh-cache to forcibly refresh the cache
  • Update CLI documentation
@BPHarris BPHarris self-assigned this Jan 11, 2022
@BPHarris BPHarris added the enhancement New feature or request label Jan 11, 2022
@BPHarris BPHarris linked a pull request Jan 11, 2022 that will close this issue
@BPHarris BPHarris mentioned this issue Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant