ballet.validation.common module¶
-
class
ballet.validation.common.
ChangeCollector
(project, differ=None)[source]¶ Bases:
object
Validate the features introduced in a proposed change set.
- Parameters
-
collect_changes
()[source]¶ Collect file and feature changes
Steps
Collects the files that have changed in this pull request as compared to a comparison branch.
Categorize these file changes into admissible or inadmissible file changes. Admissible file changes solely contribute python files to the contrib subdirectory.
Collect features from admissible new files.
- Return type
-
class
ballet.validation.common.
CollectedChanges
(file_diffs, candidate_feature_diffs, valid_init_diffs, inadmissible_diffs, new_feature_info)[source]¶ Bases:
tuple
-
candidate_feature_diffs
: List[git.diff.Diff]¶ Alias for field number 1
-
file_diffs
: git.diff.DiffIndex¶ Alias for field number 0
-
inadmissible_diffs
: List[git.diff.Diff]¶ Alias for field number 3
-
new_feature_info
: List[ballet.validation.common.NewFeatureInfo]¶ Alias for field number 4
-
valid_init_diffs
: List[git.diff.Diff]¶ Alias for field number 2
-
-
class
ballet.validation.common.
NewFeatureInfo
(importer, modname, modpath)[source]¶ Bases:
tuple
-
importer
: Callable[], module]¶ Alias for field number 0
-
modname
: str¶ Alias for field number 1
-
modpath
: str¶ Alias for field number 2
-
-
ballet.validation.common.
check_from_class
(check_class, obj, *checker_args, **checker_kwargs)[source]¶
-
ballet.validation.common.
get_accepted_features
(features, proposed_feature)[source]¶ Deselect candidate features from list of all features
- Parameters
- Return type
List
[Feature
]- Returns
list of features with the proposed feature not in it.
- Raises
ballet.exc.BalletError – Could not deselect exactly the proposed feature.
-
ballet.validation.common.
get_proposed_feature
(project)[source]¶ Get the proposed feature
The path of the proposed feature is determined by diffing the project against a comparison branch, such as master. The feature is then imported from that path and returned.
- Parameters
project (
Project
) – project info- Raises
ballet.exc.BalletError – more than one feature collected