mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
530 stars 343 forks source link

Update to the copyright #770

Closed sginoza closed 2 years ago

sginoza commented 2 years ago

Hi all,

There was an update to the copyright recently, where "Simplified" was replaced with "Revised". Seemingly, because the text doesn't match, the output from pyang warns that the copyright statement is missing. Is it possible to update the check to look for "Code Components extracted from this document must include Revised BSD License ..." rather than "Code Components extracted from this document must include Simplified BSD License ..." (i.e., s/Simplified/Revised)?

Example warning from RFC-to-be 9144 https://www.rfc-editor.org/authors/rfc9144.txt: ietf-nmda-compare@2021-11-17.yang:58: warning: RFC 8407: 3.1: The IETF Trust Copyright statement seems to be missing (see pyang --ietf-help for details).

Thanks!

mbj4668 commented 2 years ago

Ok, I have a fix where pyang allows both "Revised" and "Simplified" if the YEAR in the statement is 2021 or earlier, and requires "Revised" if YEAR 2022 or later. This way pyang won't start to complain on already published modules.

Does this work for you?

llhotka commented 2 years ago

What about a similar issue #757?

mbj4668 commented 2 years ago

I agree w- what you propose in #757. @sginoza do you agree?

sginoza commented 2 years ago

@mbj4668 - "Does this work for you?" -- yes, thank you! It would be helpful if a new version were released to https://pypi.org/project/pyang/ - is that possible?

Regarding #757 I think we should consider the common case - what text should appear more generally? The warning should appear when the text doesn't match the general case. I think the common case is for that last paragraph to appear in the modules -- please correct me if this is incorrect. If this is true, I fear not checking for the last paragraph may lead to authors/reviewers/RPC missing this paragraph where it should appear. The downside of this would be that we will ask the authors to verify that the text does not need to appear when we get that warning.

llhotka commented 2 years ago

The downside of this would be that we will ask the authors to verify that the text does not need to appear when we get that warning.

What's worse is that RFC Editor wants this error to disappear before proceeding with a document. It happened to me - we had to ask an area director for approval that it can be ignored.

mbj4668 commented 2 years ago

So with the fix (currently in branch mbj/ietf), pyang will give the warning for modules called ietf- but not for modules called iana-.

llhotka commented 2 years ago

OK, this might be sufficent, thanks.

sginoza commented 2 years ago

@mbj4668 This sounds good - thank you for the updates! I'll test it when I'm able to pick up a new release. THANK YOU!

mbj4668 commented 2 years ago

I have published a new release 2.5.1 with this fix.

llhotka commented 2 years ago

There is a regression in 2.5.1, see #774