Skip to content

Conversation

@pj-simpson
Copy link
Collaborator

@pj-simpson pj-simpson commented Oct 3, 2025

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:

  • I will also merge the changes from the Hackathon day, which utilize AI tools to report on the incomplete code snippets.
  • I may do something about all those emojis

@cursor
Copy link

cursor bot commented Oct 3, 2025

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.

@vercel
Copy link

vercel bot commented Oct 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codat-docs Ready Ready Preview Comment Oct 6, 2025 11:28am

@andy-white-hat
Copy link
Contributor

andy-white-hat commented Oct 3, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Licenses 0 0 0 0 0 issues
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link

github-actions bot commented Oct 3, 2025

Overall readability score: 57.84 (🟢 +0.01)

File Readability
README.md 39.68 (🟢 +4.96)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
README.md 39.68 37.5 13.25 14.7 14.85 8.77
  🟢 +4.96 🟢 +1.82 🟢 +0.65 🟢 +1.3 🟢 +0.81 🟢 +0.16

Averages:

  Readability FRE GF ARI CLI DCRS
Average 57.84 48.55 10.36 11.59 12.12 7.83
  🟢 +0.01 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

Link check results for preview deployment (https://codat-docs-git-refactoring-docker-bits-codat.vercel.app):

[
  "[401] https://codat-docs-git-refactoring-docker-bits-codat.vercel.app/"
]

Copy link

@joshstewartmax joshstewartmax left a 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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: typo

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 😆

@pj-simpson pj-simpson merged commit 22a0ccd into main Oct 8, 2025
6 of 8 checks passed
@pj-simpson pj-simpson deleted the refactoring-docker-bits branch October 8, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants