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

idnits v3 #27

Draft
wants to merge 64 commits into
base: v2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
7b3feb1
docs: update README
NGPixel Feb 22, 2023
89de3fa
chore: legacy docs cleanup
NGPixel Feb 22, 2023
b9f2d2f
feat: base app structure
NGPixel Mar 3, 2023
3113bec
test: add jest + coverage config
NGPixel Mar 7, 2023
f79f1b9
feat: filename checks + tests
NGPixel Mar 7, 2023
51fc6cb
docs: update README
NGPixel Mar 7, 2023
4a4a6b8
chore: update package main script
NGPixel Mar 7, 2023
e07f7b4
feat: basic xml parsing
NGPixel Mar 8, 2023
70a6717
chore: set coverage target
NGPixel Mar 8, 2023
e8b7bd8
feat: xml parser extract external entities
NGPixel Mar 8, 2023
dbbaa01
feat: more filename checks + ref url in errors
NGPixel Mar 8, 2023
ae52d0f
docs: add ValidationError constructor comments
NGPixel Mar 8, 2023
5b78c69
docs: update README.md
NGPixel Mar 21, 2023
f939d08
feat: raw string checks + modes + new validation result return
NGPixel Mar 22, 2023
9b2942c
feat: cli output + encoding checks
NGPixel Mar 23, 2023
c226baf
feat: output options
NGPixel Mar 23, 2023
be060a1
docs: update README.md
NGPixel Mar 23, 2023
b65e070
docs: update README.md
NGPixel Mar 23, 2023
bd25f13
feat: validate abstract section (xml)
NGPixel Mar 25, 2023
13ad575
chore: update package.json
NGPixel Mar 25, 2023
ae2a636
chore: define publish files in package.json
NGPixel Mar 25, 2023
705884b
ci: add publish.yml workflow
NGPixel Mar 25, 2023
d4cde62
docs: update README.md
NGPixel Mar 25, 2023
d5701a0
docs: update README.md
NGPixel Mar 25, 2023
50df1e2
feat: xml ipr validations + doc name match validation
NGPixel Mar 29, 2023
82a5a27
feat: validate txt over-long lines + various improvements
NGPixel Mar 29, 2023
001dda6
feat: validateIntroductionSection
NGPixel Mar 30, 2023
7a55f18
feat: validate abstract section with nested references
NGPixel Mar 30, 2023
7e3a49a
feat: validateSecurityConsiderationsSection check
NGPixel Mar 30, 2023
ffdae16
feat: CLI filter severity types option
NGPixel Mar 30, 2023
f475b4d
feat: detect deprecated elements + async progress text
NGPixel Mar 31, 2023
4806794
ci: add npm provenance flag
NGPixel Apr 19, 2023
9d38b97
feat: add solarized option
NGPixel Apr 26, 2023
8a4b18b
docs: add --solarized flag info
NGPixel Apr 26, 2023
3999ad7
feat: validate author sections (xml only)
NGPixel May 18, 2023
48a04df
fix: load package.json from script dir instead of cwd
NGPixel May 18, 2023
fdc719d
fix: use import.meta.url rather than dirname because of ESM
NGPixel May 18, 2023
5ec673e
test: add validateAuthorSection tests
NGPixel May 18, 2023
0471769
feat: validate references section(s)
NGPixel May 18, 2023
7e4192c
fix: handle author org with attributes
NGPixel May 18, 2023
e85b1a0
feat: validate IANA considerations section + version detection
NGPixel May 25, 2023
60537b2
feat: IP + FQDN validations (wip)
NGPixel Jun 2, 2023
dad7e71
feat: validate RFC2119 keywords (wip) + validate terms
NGPixel Jun 8, 2023
4bad584
feat: RFC2119 boilerplate validations (xml)
NGPixel Jun 9, 2023
a83154f
feat: txt doc header parsing
NGPixel Jun 10, 2023
0cc0687
feat: txt filename in doc validation + author with no affiliation
NGPixel Jun 14, 2023
0a95a05
feat: validate code blocks
NGPixel Aug 2, 2023
56c757d
feat: validateTextLikeRefs for xml
NGPixel Aug 4, 2023
f401b11
feat: validateDate
NGPixel Aug 5, 2023
0f947be
feat: validateSubmissionType
NGPixel Aug 8, 2023
0854c89
test: add remote validateSubmissionType tests mocks
NGPixel Aug 8, 2023
164d3e6
feat: validateObsoleteUpdateRef + various fixes
NGPixel Sep 7, 2023
2b50629
feat: obsoletes / updates RFC that is already obsoleted / updated check
NGPixel Nov 1, 2023
2d3969a
feat: validate category
NGPixel Nov 2, 2023
53a796f
feat: validate doc version
NGPixel Nov 2, 2023
9a5616c
chore(deps): Update dependencies (#30)
kesara Feb 16, 2024
db7c542
docs: Update README.md
NGPixel Mar 22, 2024
7679f23
chore: Update issue templates
NGPixel Mar 22, 2024
9743587
ci: Update publish.yml
NGPixel Mar 22, 2024
ca25891
docs: Update README.md
NGPixel Mar 22, 2024
e9f904e
fix: run tests on windows
NGPixel Dec 16, 2024
ff7ac86
feat: missing introduction section (#55)
Dmutre Jan 8, 2025
eecad83
feat: missing author address section (#54)
Dmutre Jan 8, 2025
9476a62
feat: missing security consideration section (#53)
Dmutre Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
indent_size = 4
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: 'standard',
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {
}
}
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/new-issue-for-idnits2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: New Issue for idnits2
about: Shell-based CLI
title: ''
labels: 'component: idnits2'
assignees: ''

---


10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/new-issue-for-idnits3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: New Issue for idnits3
about: Javascript-based CLI / Library
title: ''
labels: 'component: idnits3'
assignees: ''

---


41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish to NPM

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Build Variables
run: |
echo "NEXT_VERSION=3.0.0-alpha.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/

- name: Set package.json version
uses: HarmvZ/[email protected]
with:
version: ${{ env.NEXT_VERSION }}

- name: Install NPM Dependencies
run: npm ci

- name: Run Tests
run: npm test

- name: Publish to NPM
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
63 changes: 63 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

dist
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save-exact = true
save-prefix = ""
fund = false
audit = false
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2023, The IETF Trust
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
82 changes: 79 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,82 @@
This is the active repository for idnits.
<div align="center">

<img src="https://raw.githubusercontent.com/ietf-tools/common/main/assets/logos/idnits.svg" alt="IDNITS" height="125" />

[![npm](https://img.shields.io/npm/v/@ietf-tools/idnits)](https://www.npmjs.com/package/@ietf-tools/idnits)
[![node-current](https://img.shields.io/node/v/@ietf-tools/idnits)](https://github.com/ietf-tools/idnits)
[![License](https://img.shields.io/github/license/ietf-tools/idnits)](https://github.com/ietf-tools/idnits/blob/v3/LICENSE)

##### Library / CLI to inspect Internet-Draft documents for a variety of conditions to conform with IETF policies.

</div>

**Note that the repository has been renamed from idnits-mirror to idnits**
> ⚠️ *This branch is for the new JS-based idnits3. For the older shell-based idnits2, [view the v2 branch](https://github.com/ietf-tools/idnits/tree/v2) isntead.*

This project began as a snapshot mirror of idnits-2.17 from https://tools.ietf.org/tools/idnits/.
- [Installation](#installation)
- [Usage](#usage)
- [As a CLI](#as-a-cli)
- [As a library](#as-a-library)
- [Tests](#tests)
- [Development](#development)
- [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md)

---

### Installation

1. Install [Node.js 18.x or later](https://nodejs.org/)
2. Install **idnits**:

```sh
npm install -g @ietf-tools/idnits
```

> You can also run idnits directly without installing it globally using `npx @ietf-tools/idnits <args>`

### Usage

#### As a CLI

```sh
idnits [args] <file path>
```

| Arguments | Alias | Description | Default |
|---|---|---|---|
| `--filter` | `-f` | Filter output to only certain severity types. Can be declared multiple times to filter multiple severity types.<br>Accepted values: `errors`, `warnings`, `comments` | |
| `--mode` | `-m` | Validation mode, must be either `normal`, `forgive-checklist` or `submission`<br>Accepted shorthands: `norm`, `n`, `f-c`, `fc`, `f`, `sub`, `s` | `normal` |
| `--no-progress` | | Disable progress messages / animations in `pretty` output.<br>No effect in other output formats. | |
| `--offline` | | Disable validations that require an internet connection. | |
| `--output` | `-o` | Output format, must be either `pretty`, `json` or `count` | `pretty` |
| `--solarized` | | Use alternate colors for a solarized light theme terminal.<br>Only used with the `pretty` output format. | |
| `--year` | `-y` | Expect the given year in the boilerplate | |
| `--help` | `-h` | Print the help text and exit | |
| `--version` | | Print the version and exit | |

#### As a library

> *coming soon*

### Tests

Tests are made using the [Jest](https://jestjs.io/) library and are located under the `tests` directory.

You can run the suite of tests using:
```sh
# Make sure you installed dependencies first:
npm install

# Run the tests
npm test
```

Code coverage is expected to reach 100%. Ensure this is still the case when making edits / adding new functionality.

### Development

1. Clone the project
2. Run `npm install`
3. Run the CLI: *(replacing `<args>` and `<file path>` with the desired flags + file path)*
```
node cli.js <args> <file path>
```
7 changes: 0 additions & 7 deletions about

This file was deleted.

Loading