All notable changes to the protowhat project will be documented in this file.
- Support Python version 3.9
- Update dependencies to up-to-date versions
- Expose
prepare_validation
fromprotowhat.checks
- Refactor SCT syntax to be an execution graph and enable derived features
- Split SCT syntax and SCT context code
- Refactor exceptions to share an interface to simplify logic
- Refactor feedback to be centralized and built from formalized components
- Add support for embedding xwhats
- Add
prepare_validation
helper for checking bash history - Add autodebug (
_debug
will be invoked automatically for instructor errors)
- Fix final feedback message after append_messsage(s) from having duplicate information
- Add (default off) append_message functionality to check_node, check_edge and has_eqaul_ast
- Add include_head option to Selector
- Add messaging helpers
- Proper handling of
ast.get_text
returningNone
inhas_code
- Handle highlight position absence (in combination with
antlr-ast
v0.7.0)
- Add bash history SCTs
- Add
State.is_root
property - Return file path in feedback if set
- Pass file path to SCT chain after
check_file
- Add
allow_errors
- Support unicode when checking files
- Fix disabling parsing file content
Feedback
doesn't need to be subclassed in depending SCT libraries._debug
now has anon_error
argument which can be set toTrue
to show debugging info on the next failure or before finishing.- No NumPy dependency
- Simplified
State.report
This release improves the base functionality for all depending SCT libraries.
- Add
_debug
SCT introspection function - Add
State.parent_state
andState.state_history
as a general state linking mechanism (usingState.creator
) - Add
TestRunner
andTestRunnerProxy
and makeReporter
aTestRunnerProxy
- Add AST and text offset support in
Runner
- Improve
Dispatcher
,Feedback
andTest
interfaces
This release enables protowhat to be the base for pythonwhat.
do_test
now runs aTest
as in pythonwhat, instead of accepting a feedback string.- the explicit Fail subclass should be used instead of relying on the old default implementation of
Test
- the
report(feedback: Feedback)
method on theState
class reintroduces a short way to gather exercise feedback, equivalent todo_test(Fail(Feedback(msg)))
, while also setting highlight info. - the
legacy_signature
decorator enables to call a function using old argument names when they are passed as keyword arguments - AST utils to dump and load a tree structure to be used in e.g. dispatching are improved
- Update parsing class interface for compatibility with antlr-ast
- Support finding dynamic nodes in AST tree (instead of just custom defined nodes)
- Change
ckeck_edge
default value ofindex
argument fromNone
to0
- This is done to break less content
- Now: explicitly define the value of the
index
argument - Later: revert default change and remove unnecessary explicit setting of the
index
argument
- Refactor based on refactor in
antlr-ast>=0.4.1
,antlr-plsql>=0.7.0
andantlr-tsql>=0.11.0
- Support
force_diagnose
State option to force passingdiagnose
tests incheck_correct
.
- Update to work with new ANTLR library versions
- Fix in
has_code()
that was causing issues in some cases.
- Maintenance on docs.
- Update argument names and argument defaults for file-related checks.
- Re-exposing the
state_dec
object in the SCT context so it can be used byshellwhat_ext
andsqlwhat_ext
.
- In
shellwhat
, it is possible that_msg
is None after callingstate.ast_dispatcher.describe
. This is now handled by including a default message for_msg
.
Contains breaking changes!
- More tests
State
now has functionality to stack messages in an array, so you can prepend messages from earliercheck
functions, similar topythonwhat
(using Jinja)
check_field
renamed tocheck_edge
.test_student_typed
renamed tohas_code
.test_or
,test_correct
andtest_not
renamed tocheck_or
,check_correct
andcheck_not
.has_equal_ast
messaging improved (more suggestive).check_node
andcheck_edge
mesaging improved (more suggestive).has_equal_ast
argument names and defaults changed.- The way the reporter raises errors has been improved, allowing for interactive experimentation with SCT functions in the future and easier testing.
- Error handling in the reporter has been cleaned up
- Most of the AST-related documentation has been moved to
sqlwhat
.