Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

feat: add file-or-directory-existence rule#291

Open
Brend-Smits wants to merge 1 commit into
todogroup:mainfrom
philips-forks:feature/new-rule-directory-file-exists
Open

feat: add file-or-directory-existence rule#291
Brend-Smits wants to merge 1 commit into
todogroup:mainfrom
philips-forks:feature/new-rule-directory-file-exists

Conversation

@Brend-Smits

Copy link
Copy Markdown
Collaborator

Motivation

Sometimes we might need to check whether a repository contains at least one directory or file whose name matches a certain regular expression. Although file-existence and directory-existence rules exist, these two can not be combined within one single rule.

Proposed Changes

This PR implements a file-or-directory-existence rule which aims at checking whether there is at least one file or directory specified in globsAny whose name matches a regular expression.

Test Plan

  • it returns a passed result if both files and directories exist matching the given pattern
  • it returns a passed result if only files exist matching the given pattern
  • it returns a passed result if only directories exist matching the given pattern
  • it returns a failed result if neither files or directories exist matching the given pattern

Original Pull Request: philips-forks#19

Co-authored-by: Dragos Serban <dragos.serban@philips.com>
Signed-off-by: Brend Smits <brend.smits@philips.com>
@Brend-Smits
Brend-Smits requested a review from hyandell as a code owner March 31, 2023 09:22
@zhaoyuheng200

Copy link
Copy Markdown
Member

I think the file-existence rule with options dirs:true cover this scenario.
directory-existence is file-existence with dirs:true and it works the for both file and dirs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants