From 18d99fd30f1e84db9dc8c40742ea5216ab0e650d Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Fri, 25 Dec 2020 10:18:01 -0500 Subject: [PATCH] Add .gitattributes file and fix line endings to match. (#1004) * NEW: .gitattributes * Fix line endings * Fix File Endings --- .gitattributes | 30 +++++++++++++++++ docs/_functions/global/IP.md | 38 +++++++++++----------- pkg/js/parse_tests/013-mx.js | 6 ++-- pkg/js/parse_tests/014-caa.js | 26 +++++++-------- pkg/js/parse_tests/018-dkim.js | 6 ++-- pkg/js/parse_tests/022-sshfp.js | 20 ++++++------ pkg/js/parse_tests/035-naptr.js | 8 ++--- pkg/js/parse_tests/complexImports/a/a.js | 6 ++-- pkg/js/parse_tests/complexImports/a/c/c.js | 16 ++++----- pkg/js/parse_tests/complexImports/b/b.js | 16 ++++----- pkg/js/parse_tests/complexImports/b/d/d.js | 6 ++-- pkg/js/parse_tests/complexImports/base.js | 16 ++++----- 12 files changed, 112 insertions(+), 82 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..8fb668851 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,30 @@ +* text=auto + +# Git itself +.gitattributes eol=lf +.gitigore eol=lf + +# dnscontrol files are unix line-endings: +*.md text eol=lf +*.js text eol=lf +*.json text eol=lf +*.yaml text eol=lf +*.zone text eol=lf +*.tsv text eol=lf + +# shell scripts are unix line-endings: +*.sh text eol=lf + +# powershell scripts are DOS line-endings: +*.ps1 text eol=crlf +*.nuspec text eol=crlf + +# Go code are unix line-endings: +*.go text eol=lf +go.mod text eol=lf +go.sum text eol=lf + +# Graphics are binary: +*.jpg binary +*.png +*.svg diff --git a/docs/_functions/global/IP.md b/docs/_functions/global/IP.md index 8c59174af..d8651c620 100644 --- a/docs/_functions/global/IP.md +++ b/docs/_functions/global/IP.md @@ -1,19 +1,19 @@ ---- -name: IP -parameters: - - ip ---- - -Converts an IPv4 address from string to an integer. This allows performing mathematical operations with the IP address. - -This does not accept IPv6 addresses. (PRs gladly accepted.) - -{% include startExample.html %} -{% highlight js %} - -var addrA = IP('1.2.3.4') -var addrB = addrA + 1 -// addrB = 1.2.3.5 - -{%endhighlight%} -{% include endExample.html %} +--- +name: IP +parameters: + - ip +--- + +Converts an IPv4 address from string to an integer. This allows performing mathematical operations with the IP address. + +This does not accept IPv6 addresses. (PRs gladly accepted.) + +{% include startExample.html %} +{% highlight js %} + +var addrA = IP('1.2.3.4') +var addrB = addrA + 1 +// addrB = 1.2.3.5 + +{%endhighlight%} +{% include endExample.html %} diff --git a/pkg/js/parse_tests/013-mx.js b/pkg/js/parse_tests/013-mx.js index c8bb48c54..ba37be2a7 100644 --- a/pkg/js/parse_tests/013-mx.js +++ b/pkg/js/parse_tests/013-mx.js @@ -1,3 +1,3 @@ -D("foo.com","none", - MX("@",15,"foo.com.") -); \ No newline at end of file +D("foo.com","none", + MX("@",15,"foo.com.") +); diff --git a/pkg/js/parse_tests/014-caa.js b/pkg/js/parse_tests/014-caa.js index a7ab0f4f5..c755ee4ba 100644 --- a/pkg/js/parse_tests/014-caa.js +++ b/pkg/js/parse_tests/014-caa.js @@ -1,13 +1,13 @@ -D("foo.com","none", - // Allow letsencrypt to issue certificate for this domain - CAA("@","issue","letsencrypt.org"), - // Allow no CA to issue wildcard certificate for this domain - CAA("@","issuewild",";"), - // Report all violation to test@example.com. If CA does not support - // this record then refuse to issue any certificate - CAA("@", "iodef", "mailto:test@example.com", CAA_CRITICAL), - // Optionally report violation to http://example.com - CAA("@", "iodef", "http://example.com"), - // Report violation to https://example.com - CAA("@", "iodef", "https://example.com", CAA_CRITICAL) -); +D("foo.com","none", + // Allow letsencrypt to issue certificate for this domain + CAA("@","issue","letsencrypt.org"), + // Allow no CA to issue wildcard certificate for this domain + CAA("@","issuewild",";"), + // Report all violation to test@example.com. If CA does not support + // this record then refuse to issue any certificate + CAA("@", "iodef", "mailto:test@example.com", CAA_CRITICAL), + // Optionally report violation to http://example.com + CAA("@", "iodef", "http://example.com"), + // Report violation to https://example.com + CAA("@", "iodef", "https://example.com", CAA_CRITICAL) +); diff --git a/pkg/js/parse_tests/018-dkim.js b/pkg/js/parse_tests/018-dkim.js index 21c8a4cfa..d08543e7a 100644 --- a/pkg/js/parse_tests/018-dkim.js +++ b/pkg/js/parse_tests/018-dkim.js @@ -1,3 +1,3 @@ -D("foo.com","none" - , TXT("dkimtest2",DKIM("this string is 255 bytes long.hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnKZogtjOlHoeY8iZ5o5brlPOsj/a2Q9Bopu1kHxlxrdw7tZVL9FzUMngiIYGrl8dbP7Rvk7TLMoxHxVkRZPBtIpsKIab/gOUoPLQVYbrAmzyguHYBwAApi3H/pvjUsK8+XF0dKY17AR96lokAPqvfBaUb+DSx8zNw2hrYWYVqvCtnxHUGEUhT1bTlEZBptH3jthis is the remainder. it is 156 bytes long.mOhl2JmbsFKy+RoMTwbkk0/meRvcEFWLHkr4MSgbnie6OpQvM4Y51+kO6DUVr3rwjrdVO9wpFt+n/hdQ92TNif17RMJtE5AGaQ6BN3yJQIDAQAB;")) -); +D("foo.com","none" + , TXT("dkimtest2",DKIM("this string is 255 bytes long.hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnKZogtjOlHoeY8iZ5o5brlPOsj/a2Q9Bopu1kHxlxrdw7tZVL9FzUMngiIYGrl8dbP7Rvk7TLMoxHxVkRZPBtIpsKIab/gOUoPLQVYbrAmzyguHYBwAApi3H/pvjUsK8+XF0dKY17AR96lokAPqvfBaUb+DSx8zNw2hrYWYVqvCtnxHUGEUhT1bTlEZBptH3jthis is the remainder. it is 156 bytes long.mOhl2JmbsFKy+RoMTwbkk0/meRvcEFWLHkr4MSgbnie6OpQvM4Y51+kO6DUVr3rwjrdVO9wpFt+n/hdQ92TNif17RMJtE5AGaQ6BN3yJQIDAQAB;")) +); diff --git a/pkg/js/parse_tests/022-sshfp.js b/pkg/js/parse_tests/022-sshfp.js index 876916512..146c92c80 100644 --- a/pkg/js/parse_tests/022-sshfp.js +++ b/pkg/js/parse_tests/022-sshfp.js @@ -1,10 +1,10 @@ -D("foo.com","none", - SSHFP("@",1,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",1,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), - SSHFP("@",2,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",2,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), - SSHFP("@",3,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",3,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), - SSHFP("@",4,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), - SSHFP("@",4,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc") -); +D("foo.com","none", + SSHFP("@",1,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@",1,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), + SSHFP("@",2,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@",2,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), + SSHFP("@",3,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@",3,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc"), + SSHFP("@",4,1,"66c7d5540b7d75a1fb4c84febfa178ad99bdd67c"), + SSHFP("@",4,2,"745a635bc46a397a5c4f21d437483005bcc40d7511ff15fbfafe913a081559bc") +); diff --git a/pkg/js/parse_tests/035-naptr.js b/pkg/js/parse_tests/035-naptr.js index 6a7299670..b8cdc9529 100644 --- a/pkg/js/parse_tests/035-naptr.js +++ b/pkg/js/parse_tests/035-naptr.js @@ -1,4 +1,4 @@ -D("foo.com","none", - NAPTR("@",100,10,"U","E2U+sip","!^.*$!sip:customer-service@example.com!","example"), - NAPTR("@",102,10,"U","E2U+email","!^.*$!mailto:information@example.com!","example") -); +D("foo.com","none", + NAPTR("@",100,10,"U","E2U+sip","!^.*$!sip:customer-service@example.com!","example"), + NAPTR("@",102,10,"U","E2U+email","!^.*$!mailto:information@example.com!","example") +); diff --git a/pkg/js/parse_tests/complexImports/a/a.js b/pkg/js/parse_tests/complexImports/a/a.js index e0ab3a0c5..279292ac5 100644 --- a/pkg/js/parse_tests/complexImports/a/a.js +++ b/pkg/js/parse_tests/complexImports/a/a.js @@ -1,3 +1,3 @@ -function a() { - return CNAME("A", "foo.com.") -} \ No newline at end of file +function a() { + return CNAME("A", "foo.com.") +} diff --git a/pkg/js/parse_tests/complexImports/a/c/c.js b/pkg/js/parse_tests/complexImports/a/c/c.js index 1cb1fad86..c492c7560 100644 --- a/pkg/js/parse_tests/complexImports/a/c/c.js +++ b/pkg/js/parse_tests/complexImports/a/c/c.js @@ -1,8 +1,8 @@ -require('../a.js'); - -function c() { - return [ - a(), - CNAME("C", "foo.com.") - ] -} \ No newline at end of file +require('../a.js'); + +function c() { + return [ + a(), + CNAME("C", "foo.com.") + ] +} diff --git a/pkg/js/parse_tests/complexImports/b/b.js b/pkg/js/parse_tests/complexImports/b/b.js index aa2491a70..74c4f48f8 100644 --- a/pkg/js/parse_tests/complexImports/b/b.js +++ b/pkg/js/parse_tests/complexImports/b/b.js @@ -1,8 +1,8 @@ -require('pkg/js/parse_tests/complexImports/b/d/d.js'); - -function b() { - return [ - d(), - CNAME("B", "foo.com.") - ]; -} \ No newline at end of file +require('pkg/js/parse_tests/complexImports/b/d/d.js'); + +function b() { + return [ + d(), + CNAME("B", "foo.com.") + ]; +} diff --git a/pkg/js/parse_tests/complexImports/b/d/d.js b/pkg/js/parse_tests/complexImports/b/d/d.js index 2a6af0c2e..37fa42f16 100644 --- a/pkg/js/parse_tests/complexImports/b/d/d.js +++ b/pkg/js/parse_tests/complexImports/b/d/d.js @@ -1,3 +1,3 @@ -function d() { - return CNAME("D", "foo.com.") -} \ No newline at end of file +function d() { + return CNAME("D", "foo.com.") +} diff --git a/pkg/js/parse_tests/complexImports/base.js b/pkg/js/parse_tests/complexImports/base.js index 7fe5770c4..b985c7527 100644 --- a/pkg/js/parse_tests/complexImports/base.js +++ b/pkg/js/parse_tests/complexImports/base.js @@ -1,8 +1,8 @@ -require('./a/c/c.js'); -require('./b/b.js'); - -D("foo.com","none", - A("@","1.2.3.4"), - c(), - b() -); \ No newline at end of file +require('./a/c/c.js'); +require('./b/b.js'); + +D("foo.com","none", + A("@","1.2.3.4"), + c(), + b() +);