Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix filename regex #316

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

mpro7
Copy link
Contributor

@mpro7 mpro7 commented Jan 6, 2025

  • add []{} special characters and improve test
  • remove not allowed ? character
  • add test for not allowed ? and / characters

@mpro7 mpro7 self-assigned this Jan 6, 2025
Copy link

linear bot commented Jan 6, 2025

@mpro7 mpro7 changed the title fix: fix filename regex fix: Fix filename regex Jan 6, 2025
@mpro7 mpro7 enabled auto-merge (squash) January 6, 2025 14:38
Copy link
Contributor

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo, otherwise it looks good, thanks!

src/test/scala/swiss/dasch/domain/AssetFilenameSpec.scala Outdated Show resolved Hide resolved
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (12ea2aa) 1763 1252 71.02%
Head commit (5db241e) 1763 (+0) 1252 (+0) 71.02% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#316) 1 1 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@mpro7 mpro7 merged commit 679c79e into main Jan 7, 2025
7 of 8 checks passed
@mpro7 mpro7 deleted the dev-4478-files-with-angular-brackets-cannot-be-ingested branch January 7, 2025 07:46
@@ -13,7 +13,7 @@ final case class AssetFilename private (value: String) extends AnyVal

object AssetFilename {
// Allow letters, numbers, underscores, hyphens, spaces, full stops, comma, single quote, apostrophe and braces
private val regex = """^[\p{L}\p{N}_\- .,'`()+=!?<>|]+$""".r
private val regex = """^[\p{L}\p{N}_\- .,'`+=!<>|()\[\]\{\}]+$""".r
Copy link
Contributor

@jnussbaum jnussbaum Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that () need to be escaped as well, because they are reserved characters in regex?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were not escaped before and all tests passed but you might have right.

mpro7 pushed a commit that referenced this pull request Jan 13, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.17.0](v0.16.0...v0.17.0)
(2025-01-07)


### Maintenances

* Remove deprecated maintenance actions from API
([#314](#314))
([1150048](1150048))
* Update copyright 2025
([#312](#312))
([c372a2b](c372a2b))


### Enhancements

* Show audio files in asset-overview-report seperately (DEV-4490)
([#313](#313))
([12ea2aa](12ea2aa))


### Bug Fixes

* Fix filename regex
([#316](#316))
([679c79e](679c79e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants