GithubHelp home page GithubHelp logo

ietf-tools / idnits Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 15.0 705 KB

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

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%
ietf internet-drafts nits

idnits's People

Contributors

kesara avatar ngpixel avatar rjsparks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

idnits's Issues

Idnits gives opposite suggestions

Describe the issue

A document I'm shepherding used to include in the abstract a phrase like "This document updates [RFCXXXX]" and Idnits requested to get rid of references there. The editors did the change, but now Idnits complaints (as a comment) that, considering the update field in the header, "the abstract doesn't seem to mention this, which it should".
To me, that I-D is fine to progress like this, but I'm not comfortable with that behavior of Idnits.

Code of Conduct

Missing References

The latest version of this tool complains about missing references when it is regular text in the draft. For example if the text in the draft says the following:

   [64496 64500]
      Matches the AS_PATH where at least one of the ASes is either 64496
      or 64500.

   [^64496 64500]
      Matches the AS_PATH where neither 64496 nor 64500 are present in
      the AS_PATH.

   [64496-64511]
      Matches the AS_PATH where at least one AS number is in the range
      64496..64511, inclusive.  This matches the documentation AS
      numbers in [RFC5398].

The tools reports the following error:

  == Missing Reference: '64496 64500' is mentioned on line 7881, but
     not defined

  == Missing Reference: '64496-64511' is mentioned on line 7889, but
     not defined

  == Missing Reference: '64505-64511' is mentioned on line 7901, but
     not defined

A non-color mode for the CLI

Using the current version on a light-mode terminal is unreadable, even with --solarized, due to the yellow text. (The baby blue is difficult but possible to read.) Please add something like --no-color. This is probably better than --readable-in-light-mode because light modes differ.

Use .cache

Right now idnits stores cache state in ~/.idnits. Modern practice seems to be to use ~/.cache/idnits.

2.17.01

This needs to be upgraded to 2.17.01.

Can't run

After installing locally to my home directory (since I can't install with -g on this box):

# ~/node_modules/@ietf-tools/idnits/cli.js draft-ietf-ace-cmpv2-coap-transport-09.txt 
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

[Error: ENOENT: no such file or directory, open './package.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: './package.json'
}

Node.js v18.13.0

IDnits should warn about updated normative references

owner:[email protected] type_enhancement | by [email protected]


From
https://mailarchive.ietf.org/arch/msg/tools-discuss/ebs8FYDGWgzTdzsj1FzMBgLBBNQ

idnits correctly produces warnings such as:

 ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200)

However, afaik, it does not produce warnings like:

 ** Updated normative reference: RFC 791 (Updated by Updated by RFC 1349, RFC 2474, RFC 6864)

I believe this would be of benefit, since it ought to prompt the authors or reviewers to check whether those updates affect the draft. In fact I've often seen references to RFC791 that show ignorance of RFC2474, so this is not an artificial problem.

(I came to this by noticing that the proposed updates to the RFC style guide have removed the statement that the RFC Editor catches references to obsoleted RFCs, as described at https://tools.ietf.org/html/rfc7322#section-4.8.6).


Issue migrated from trac:573 at 2022-02-08 07:11:18 +0000

Rewrite idnits as a JS library + CLI

This proposal is for a rewrite of idnits in javascript, so that it can run both natively in the browser and on the server / console.

General Implementation

  • Implemented as a ESM library, exposing a single async function checkNits(opts), that resolves to a result object.
  • A separate cli.js parses command line arguments, calls the library and output the results in a console friendly format.
  • Section texts should be stored in a separate .json file.

Distribution

As a NPM package that can be both embedded into a web application or used as a standard CLI, on any platform supported by Node.js.

Arguments

Outdated
CLI mode Library mode Description
--version N/A Print the version and exit
--help N/A Print the help text and exit
--nowarn nowarn: false Don't issue warnings, only ID-Checklist violations
--verbose N/A Show more information about offending lines
--nitcount N/A Show a count of nits
--debug N/A Debug output, especially of boilerplate matching
--year year: 2023 Expect the given year in the boilerplate
--checklistwarn N/A Only warn (no errors) for ID-Checklist violations
--nonascii noascii: false Disable warnings for non-ascii characters
--submitcheck submitcheck: false Only output errors and warnings related to 1id-guidelines
--status doctype status: 'doctype' Assume the given intended document type

See README.md instead.

Returns

{
  result: string, // either "success" or "failed"
  file: {
    path: string, // Path of the document
    lines: Number, // Number of total lines processed
    size: Number // filesize in bytes
  },
  issues: [
    {
      lines: Array<Number>, // start and end line number (starts at 1), e.g. [1,5]
      message: string, // error message
      ref: string, // optional link reference
      level: string // either "warn" or "error"
    },
    ...
  ]
}

Web UI Mockup

The library could be integrated into a web app, allowing the user to browse for a document to validate. The document would be presented in a code editor like view, with warnings / errors shown on relevant lines (either inline or on the side).

ui-mockup

Breakdown of the Current Implementation

  1. starts at L3053
  2. calls check_line()
    1. check line length
    2. check line spacing
    3. check line ending with hyphenated word
    4. check ascii chars only and not ctrl chars
    5. check that abstract and "status of memo" are not numbered
    6. check RFC 2119 language
    7. check example domain names
    8. check ipv4 addresses
  3. calculate page count
  4. warn if draft starts with PK or BM
  5. normalize text and try a list of matches
    1. calls match_para()
  6. calls report()
    1. todo

Original idnits SOW

idnits-SOW-00.pdf

Clarifying MISSING_REFERENCES_TITLE lint

Hi,

I'm trying out idnits v3 (3.0.0-alpha.33) and it works great but there's one lint I'm wondering about:

2  Error
 └- Code - MISSING_REFERENCES_TITLE
 └- Desc - The references section is missing a title attribute.
 └- Ref  - https://authors.ietf.org/required-content#references
 └- Path - rfc.back.references[0].title

I've been looking through the already published RFCs but the <reference> tags seem to be missing titles there too:

$ curl -sSL https://www.rfc-editor.org/rfc/rfc8949.xml | grep '<references'
    <references pn="section-11">
      <references pn="section-11.1">
      <references pn="section-11.2">

Where can I learn more about the title attribute and the reasoning for this lint?

(Context: I'm producing the XML from Markdown via mmark but before I submit an issue there I'd like to understand the reasoning).

Thank you for your time! 👋

FILENAME_MISSING_COMPONENTS is based on advice, not a rule

draft-rswg-rfc7997bis is draft in the RSWG, and the filename is completely legal. The description of "Filename must consists of at least 4 components" does not match some of the names described on https://authors.ietf.org/naming-your-internet-draft.

This file also gets FILENAME_INVALID_VERSION_SUFFIX and FILENAME_DOCNAME_MISMATCH errors, which is probably queued off of the above. The docname in the file is draft-rswg-rfc7997bis-02, which has a valid version suffix.

Unused RFC reference warning when reference is in Appendix

Hello,

I am receiving following warning for my Internet Draft. draft-viathinksoft-oidip-03 :

Unused Reference: 'RFC8792' is defined on line 1056, but no explicit reference was found in the text

Example:
https://author-tools.ietf.org/api/idnits?url=https://www.ietf.org/archive/id/draft-viathinksoft-oidip-03.txt

But RFC8792 is used in the Appendix.

I have put the Appendix after the References section as recommended by many sources.

Did I do something wrong?

Kind regards,
Daniel Marschall

Screen for cross-stream obsoletes/updates

owner:[email protected] type_enhancement | by [email protected]


From https://mailarchive.ietf.org/arch/msg/tools-discuss/MQLDxikNfhZggHZBLp-v13xEmOA

Hi,

Been discussing this with the other stream heads and wondered whether there
is space for a feature in your To Do list for idnits.

I see at https://tools.ietf.org/tools/idnits/todo that you have an item for
cross-checking obsoletion of higher level docs.

Could you also check for obsoletes/updates across streams (e.g., an
Independent Submission attempts to Obsolete an IETF Stream RFC) and generate
a warning such as:

"This document attempts to obsolete/update an RFC from another stream.
Specific rules may apply to this process, and you will need sign-off from
both stream heads before this document can proceed."

Very much appreciate the work that the tools team does.

Best,
Adrian
--
Adrian Farrel
Independent Submissions Editor (ISE)
[email protected]

Issue migrated from trac:452 at 2022-02-08 07:03:24 +0000

Stop accepting older variant of boilerplate

At 06d166e we shifted to accepting both an older and corrected string for describing the BSD license in the boilerplate. This was to allow idnits to succeed as people updated their versions of xml2rfc et.al.

Enough time has passed that we should now strictly accept only the corrected version.

Attempt to download rfcxxxx state ... error

A run of idnits with the latest version results in the following error for all RFC cited in the draft. In this case it was being run against draft-ietf-idr-bgp-model-15.txt

Attempted to download rfc8277 state...
The downloaded file seems to be corrupt, proceeding with outdated information.

Removing the .idnits directory in home does not help.

pypi

Pypi lists idnits at version 3, but this repos seems to have 2.17.1.

Please tag versions

Hi, I'm a maintainer for the Homebrew package manager. We maintain an idnits package but we don't have a way of checking for new versions at the moment. We used to check the tarball link on the previous website but the idnits page started redirecting to https://www6.ietf.org/tools/idnits/ around 2021-11 and the current website is only an online checker (no tarball link or version information).

I happened upon this repository and it seems like something we could migrate to in the future (now that it's no longer just a mirror) but we can't use it until there are version tags. Could you please create a tag for 2.17.00 (preferably pointing to the original commit, bfda9518d5b4e8a682f2e6f34a449c2d3ea745390)? Similarly, would you be willing to commit to tagging new versions as they're released? This would make it easy for us to download a snapshot of a given version and allow us to programmatically check the tags for new versions.

Somewhat related, are there any plans for releasing a new version? I see there are some new commits after 2.17.00 but the version in the idnits file remains the same.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.