Movatterモバイル変換


[0]ホーム

URL:


All
Pages
Start typing to search…

Path Regexp

Outlining our regular expression technique used

The Codecov Yaml accepts regexp patterns to filter report content. Detailed below is the strategy of how codecov processes these paths.

Regexp patterns

Codecov will try to ensure regex patterns input as a string by the user are gracefully handled and that string is used as a pattern to identify which paths to include/exclude from their report.

Codecov does this by taking the user input and transforming it into a regex that Python can process. The user can input three types of patterns:

  • path_prefix,
  • regex, and
  • glob.

Codecov tries to determine which type of pattern the user inputted. We say "try" because some paths can be more than one type, and we try our best to see what the user meant. After determining the type, the code converts that type of pattern to aregex (in case the user inputted aregex, it is used as it is).

One additional processing we do is to account for the usage of! by the user.! means negation, and although we supportignore fields, sometimes the users prefer to just use! to denote something they want to exclude.

🚧

Status Checks and Flags do not support Regex rules

At this time, the CodecovFlags andStatus Checks features do not accept regex-based paths

ExpressionResult
/pathinclude^path.*
path/include^path/.*
path/*include^path/.*
path/to/file.rb$include^path/to/file.rb$
*/testsinclude.*/tests.*
'!path'exclude^path.\*

Logic

if any negative match:  skipelse if has positive matches:  if positive match found:    include  else:    skipelse:  include

Updated about 1 month ago



[8]ページ先頭

©2009-2025 Movatter.jp