-
Notifications
You must be signed in to change notification settings - Fork 41
Refactoring the code checker functionality #1688
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
Conversation
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on October 20. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Overall readability score: 57.84 (🟢 +0.01)
View detailed metrics🟢 - Shows an increase in readability
Averages:
View metric targets
|
|
Link check results for preview deployment (https://codat-docs-git-refactoring-docker-bits-codat.vercel.app): |
joshstewartmax
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some minor nitpicks but nothing major to add really!
|
|
||
| # Run compiler checks on extracted code | ||
| uv run code-util check | ||
| # Run compiler checks on extracted code, (can only be done on lang at a time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: what a long file name 😆
Refactoring the Code Utils to be more 'production ready', after the positive response in the Hackathon.
This PR refactors the 'Code Checker' functionality of the CLI Tool: i.e. the part which builds a container, copies in the complete code files of code snippets from our docs, and then runs a command in that container to check that the code snippets compile, (or runs 'pyright' in the case of python).
I have attempted to use dependency-injection (or rather what passes for DI in python!), to make the code more comprehensible and testable, (and added some pytest tests!)
CodeChecker Class: Contains state around the docker configuration of the language specific context we want to use, like commands we want to run to check the lang files and location of the Dockerfile to use.
==> Depends on ==>DockerOperator Class: carries out interactions with the Docker API, like building containers, running commands in the containers and capturing the output.
FUTURE WORK: