diff options
Diffstat (limited to 'crates/shirabe/src/util/config_validator.rs')
| -rw-r--r-- | crates/shirabe/src/util/config_validator.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/shirabe/src/util/config_validator.rs b/crates/shirabe/src/util/config_validator.rs index 52560caa..e9282a9f 100644 --- a/crates/shirabe/src/util/config_validator.rs +++ b/crates/shirabe/src/util/config_validator.rs @@ -10,7 +10,7 @@ use crate::package::loader::ValidatingArrayLoader; use indexmap::IndexMap; use serde::de::Error as _; use shirabe_php_shim::Catch as _; -use shirabe_php_shim::{PhpMixed, php_regex, preg_match2, preg_replace}; +use shirabe_php_shim::{PhpMixed, php_regex, preg_match, preg_replace}; use shirabe_spdx_licenses::SpdxLicenses; #[derive(Debug)] @@ -117,15 +117,14 @@ impl ConfigValidator { for license in &licenses { let spdx_license = license_validator.get_license_by_identifier(license); if spdx_license.is_some_and(|l| l.is_deprecated_license_id) { - if preg_match2(php_regex!(r"{^[AL]?GPL-[123](\.[01])?\+$}i"), license, 0) - .is_some() + if preg_match(php_regex!(r"{^[AL]?GPL-[123](\.[01])?\+$}i"), license).is_some() { warnings.push(format!( "License \"{}\" is a deprecated SPDX license identifier, use \"{}-or-later\" instead", license, license.replace('+', "") )); - } else if preg_match2(php_regex!(r"{^[AL]?GPL-[123](\.[01])?$}i"), license, 0) + } else if preg_match(php_regex!(r"{^[AL]?GPL-[123](\.[01])?$}i"), license) .is_some() { warnings.push(format!( @@ -148,7 +147,7 @@ impl ConfigValidator { if let Some(PhpMixed::String(name)) = manifest.get("name") && !name.is_empty() - && preg_match2(php_regex!(r"{[A-Z]}"), name, 0).is_some() + && preg_match(php_regex!(r"{[A-Z]}"), name).is_some() { let suggest_name = preg_replace( php_regex!(r"{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}"), @@ -225,7 +224,7 @@ impl ConfigValidator { packages.extend(require_dev); for (package, version) in &packages { if let PhpMixed::String(version_str) = version - && preg_match2(php_regex!(r"{#}"), version_str, 0).is_some() + && preg_match(php_regex!(r"{#}"), version_str).is_some() { warnings.push(format!( "The package \"{}\" is pointing to a commit-ref, this is bad practice and can cause unforeseen issues.", |
