this is an architecture file, which outlines the general structure of this codebase.
The goal of the library is to, given a list of files, determine the relevant test command to run using machine learning a big if-else statement.
in context.py
When the root command (t
) is run, it collects information about the directory it's been run in. It's passed to the other methods and helps with determining which files are present and their contents.
in commands.py
Each available test command (such as npm test
or pytest
) has a corresponding Command
instance. They each hold:
- a function to determine if, based on a given context, this
command
should be run - the resulting test command
in commands.py
find_test_command
is the aforementioned "big if
statement", which is technically a return
in a loop. For each command, if command.should_run(context)
is True
, the object is returned (and executed).