From c5e55680105e7c24f7c49cf4eb95381ae358a476 Mon Sep 17 00:00:00 2001 From: Santiago Traversa Date: Thu, 30 Jan 2025 13:15:40 -0300 Subject: [PATCH 1/3] Adds markdownlint - CONTRIBUTING.md:5 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h3; Actual: h4] - README.md:66:234 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] --- .markdownlint.yaml | 13 +++++++++++++ CONTRIBUTING.md | 8 ++++---- README.md | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 .markdownlint.yaml diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..5935c62 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,13 @@ +--- +default: true + +# no-hard-tabs +MD010: + code_blocks: false + +# no-multiple-blanks +MD012: + maximum: 2 + +# line-length +MD013: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 625dc3e..6a48890 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Getting started -#### 1. Clone the repository +### 1. Clone the repository Clone the repository and move into it: @@ -11,15 +11,15 @@ git clone git@github.com:dnsimple/dns_erlang.git cd dns_erlang ``` -#### 2. Install Erlang +### 2. Install Erlang -#### 3. Create your own working branch +### 3. Create your own working branch ```shell git checkout -b dev_new_feature_xyz ``` -#### 3. Build and test +### 3. Build and test Compile the project and [run the test suite](#testing) to check everything works as expected. diff --git a/README.md b/README.md index a125be4..f0db175 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Note that all support RR types must include a `dns_rrdata_` record definition, u The `dns` module is the primary entry point for the functionality in this library. The module exports various types used in type specs, such as `message()`, which indicates a `#dns_message` record, `query()` which represents a single `#dns_query` record, `questions()`, which represents a list of queries, etc. -It also exports functions for encoding and decoding messages, TSIG supporting functions, and various utility functions for comparing domain names, converting domain names into different cases, converting to and from label lists, etc. +It also exports functions for encoding and decoding messages, TSIG supporting functions, and various utility functions for comparing domain names, converting domain names into different cases, converting to and from label lists, etc. ### dns\_record.erl From 5033bb1957261ebc24663282d02c49c9f8b8220e Mon Sep 17 00:00:00 2001 From: Santiago Traversa Date: Thu, 30 Jan 2025 13:46:37 -0300 Subject: [PATCH 2/3] Adds YAMLlint ./.github/dependabot.yml 1:1 warning missing document start "---" (document-start) ./.github/workflows/check_deps.yml 1:1 warning missing document start "---" (document-start) ./.github/workflows/ci.yml 1:1 warning missing document start "---" (document-start) 6:16 error too many spaces inside brackets (brackets) 6:23 error too many spaces inside brackets (brackets) --- .github/dependabot.yml | 2 ++ .github/workflows/check_deps.yml | 2 ++ .github/workflows/ci.yml | 5 ++++- .yamllint | 9 +++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .yamllint diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0ef8c69..320a65e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,5 @@ +--- + version: 2 updates: - package-ecosystem: "github-actions" diff --git a/.github/workflows/check_deps.yml b/.github/workflows/check_deps.yml index 133ebc6..d36288b 100644 --- a/.github/workflows/check_deps.yml +++ b/.github/workflows/check_deps.yml @@ -1,3 +1,5 @@ +--- + name: Check Dependencies on: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b5c8d6..1001cd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,12 @@ +--- + name: CI on: pull_request: push: - branches: [ "main" ] + branches: + - main workflow_dispatch: concurrency: diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..f383e9d --- /dev/null +++ b/.yamllint @@ -0,0 +1,9 @@ +--- +extends: default +rules: + line-length: + max: 256 + level: warning + truthy: + ignore: | + /.github/workflows/*.yml From 6c5343c341457bf66674bb07491db4eb83e81f05 Mon Sep 17 00:00:00 2001 From: Santiago Traversa Date: Thu, 30 Jan 2025 13:49:18 -0300 Subject: [PATCH 3/3] Adds YAMLlint and Markdown linter to CI --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1001cd9..3aa4f2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,25 @@ concurrency: cancel-in-progress: true jobs: + yamllint: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Run YAML Lint + uses: actionshub/yamllint@main + + markdownlint-cli: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Run markdownlint-cli + uses: nosborn/github-action-markdown-cli@v3.4.0 + with: + files: . + config_file: ".markdownlint.yaml" + build: name: Build runs-on: ubuntu-latest @@ -47,6 +66,8 @@ jobs: needs: - build + - markdownlint-cli + - yamllint steps: - uses: actions/checkout@v4