Workspace.Checks.ValidateAffectedBy (Workspace v0.4.2)

View Source

Checks that the :affected_by paths of the projects are valid

A path declared in a project's :affected_by config is considered invalid if:

  • it does not match any file of the repository, e.g. due to a typo or a renamed directory. In this case changes that should affect the project would silently be ignored.
  • it is within the project's own path. Changes of the project's files already mark it as modified, so such a path has no effect.

Only the files known to git are considered, e.g. tracked files and untracked files that are not ignored. Paths are matched exactly as during the workspace status update, so this check requires the workspace to be in a git repository.

Notice that paths within other workspace projects are valid, since a project may depend on files of another project without a mix dependency between them.

Example

In order to configure this check add the following, under checks, in your .workspace.exs:

[
  module: Workspace.Checks.ValidateAffectedBy,
  description: "all affected_by paths must be valid"
]