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

Feature: extend slice acronym validator to not accept underscore #176

Merged

Conversation

syphax-bouazzouni
Copy link

@syphax-bouazzouni syphax-bouazzouni force-pushed the pr/feature/extend-slice-acronym-validator branch from cddda76 to da59b8c Compare October 28, 2023 08:04
@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Merging #176 (da59b8c) into develop (b5057b4) will increase coverage by 0.14%.
Report is 84 commits behind head on develop.
The diff coverage is 83.97%.

❗ Current head da59b8c differs from pull request most recent head c9e05b2. Consider uploading reports for the commit c9e05b2 to get more accurate results

@@             Coverage Diff             @@
##           develop     #176      +/-   ##
===========================================
+ Coverage    80.75%   80.90%   +0.14%     
===========================================
  Files           63       63              
  Lines         4848     4912      +64     
===========================================
+ Hits          3915     3974      +59     
- Misses         933      938       +5     
Flag Coverage Δ
unittests 80.90% <83.97%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
lib/ontologies_linked_data/diff/bubastis_diff.rb 76.19% <100.00%> (ø)
lib/ontologies_linked_data/mappings/mappings.rb 80.99% <100.00%> (-0.96%) ⬇️
lib/ontologies_linked_data/models/base.rb 71.96% <100.00%> (+4.25%) ⬆️
...linked_data/models/properties/ontology_property.rb 84.78% <100.00%> (+0.06%) ⬆️
lib/ontologies_linked_data/models/users/user.rb 90.76% <100.00%> (+0.29%) ⬆️
lib/ontologies_linked_data/monkeypatches/object.rb 71.73% <100.00%> (+1.68%) ⬆️
lib/ontologies_linked_data/parser/owlapi.rb 86.40% <100.00%> (+5.82%) ⬆️
lib/ontologies_linked_data/serializers/json.rb 80.88% <100.00%> (ø)
lib/ontologies_linked_data/models/slice.rb 84.84% <80.00%> (-0.87%) ⬇️
lib/ontologies_linked_data/serializers/xml.rb 68.96% <0.00%> (ø)
... and 3 more

... and 1 file with indirect coverage changes

@mdorf
Copy link
Member

mdorf commented Nov 1, 2023

@syphax-bouazzouni, I am looking at the code code changes and not seeing anything there that prevents the underscores in the slice acronyms:

      if acronym.match(/[^-0-9a-zA-Z]/)
        errors << [:special_characters, "`acronym` must only contain the folowing characters: -, _, letters, and numbers"]
      end

In fact, the error message states that "_"s are allowed.

@syphax-bouazzouni syphax-bouazzouni force-pushed the pr/feature/extend-slice-acronym-validator branch from da59b8c to c9e05b2 Compare November 1, 2023 21:51
@syphax-bouazzouni
Copy link
Author

@syphax-bouazzouni, I am looking at the code changes and not seeing anything there that prevents the underscores in the slice acronyms:

      if acronym.match(/[^-0-9a-zA-Z]/)
        errors << [:special_characters, "`acronym` must only contain the folowing characters: -, _, letters, and numbers"]
      end

In fact, the error message states that "_"s are allowed.

Hello @mdorf,
This regex acronym.match(/[^-0-9a-zA-Z]/) enforces the acronym to contain only a number, letter or '-'.

I copied/reused this line from the ontology acronym validator code, and forget to remove the "_" from the error message. I updated the message to remove it for the error message

@mdorf mdorf merged commit d5bbed1 into ncbo:develop Nov 1, 2023
0 of 2 checks passed
mdorf added a commit that referenced this pull request Nov 1, 2023
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