Writing check50 extensions¶
Core to check50’s design is extensibility. Not only in checks, but also in the tool itself. We designed
check50.flask to be extensions of check50 that ship with check50. By design these three modules are all standalone and only depend on the core of check50, and no other part of check50 depends on them. In other words, you can remove or add any of these modules and check50 would still function as expected.
We ship check50 with three extensions because these extensions are core to the material cs50 teaches. But different courses have different needs, and we realize we cannot predict and cater for every usecase. This is why check50 comes with the ability to pip install other Python packages. You can configure this via the
dependencies key in
.cs50.yaml. Through this mechanism you can write your own extension and then have check50 install it for you whenever check50 runs. Host your extension anywhere pip can install from, for instance GitHub or PyPi. And all you have to do then is to fill in the
dependencies key of
.cs50.yaml with the location of your extension. check50 will make sure your extension is always there when the checks are run.
In addition to all the functionality check50 exposes, we expose an extra API for extensions in
check50.internal. You can find the documentation in API docs.
.js file through an interpreter such as
You can find example checks using check50_js and their solutions at:
To try any of these examples for yourself, simply run:
wget https://raw.githubusercontent.com/cs50/check50/examples/solutions/hello_js/hello.js check50 cs50/check50/examples/js/hello
wget https://raw.githubusercontent.com/cs50/check50/examples/solutions/line_js/line.js check50 cs50/check50/examples/js/line
wget https://raw.githubusercontent.com/cs50/check50/examples/solutions/addition_js/addition.js check50 cs50/check50/examples/js/addition