Skip to content

Adds ipaddr filter to test if string is valid IP Address.#237

Merged
mattcoley merged 4 commits into
masterfrom
ipaddr-filter
Oct 14, 2018
Merged

Adds ipaddr filter to test if string is valid IP Address.#237
mattcoley merged 4 commits into
masterfrom
ipaddr-filter

Conversation

@mattcoley

@mattcoley mattcoley commented Sep 19, 2018

Copy link
Copy Markdown
Collaborator

Support for #236

Adds ipaddr filter to test if string is valid IPv4 or IPv6 filter. Checking IPv6 is tricky due to the compression, however the regex seems to be working against the tests.

@codecov-io

codecov-io commented Sep 19, 2018

Copy link
Copy Markdown

Codecov Report

Merging #237 into master will increase coverage by 0.03%.
The diff coverage is 84.61%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #237      +/-   ##
============================================
+ Coverage      71.6%   71.64%   +0.03%     
- Complexity     1378     1386       +8     
============================================
  Files           218      219       +1     
  Lines          4350     4363      +13     
  Branches        689      693       +4     
============================================
+ Hits           3115     3126      +11     
- Misses          999     1000       +1     
- Partials        236      237       +1
Impacted Files Coverage Δ Complexity Δ
.../com/hubspot/jinjava/lib/filter/FilterLibrary.java 100% <ø> (ø) 4 <0> (ø) ⬇️
...a/com/hubspot/jinjava/lib/filter/IpAddrFilter.java 84.61% <84.61%> (ø) 8 <8> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 649bda5...8bc8fa4. Read the comment docs.

}

if (object instanceof String) {
String address = (String) object;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this do a trim() first?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yea that would be smart.

@mattcoley mattcoley requested a review from boulter September 19, 2018 14:09
@mattcoley mattcoley merged commit 9adc8e1 into master Oct 14, 2018
@mattcoley mattcoley deleted the ipaddr-filter branch October 14, 2018 17:02
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