Skip to content

Commit

Permalink
" Add deprecated withdrawn"
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoWeezy committed Jun 4, 2024
1 parent 21c9bbc commit a069464
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ error[preamble-order]: preamble header `description` must come after `title`
| `preamble-req` | All required preamble headers are present. |
| `preamble-req-category` | The `category` header is present only when required. |
| `preamble-req-last-call-deadline` | The `last-call-deadline` header is present only when required. |
| `preamble-req-withdrawal-reason` | The `withdrawal-reason` header is present only when required. |
| `preamble-req-withdrawal-reason` | The `withdrawal-reason` header is present only when required.
| `preamble-req-deprecated-reason` | The `deprecated-reason` header is present only when required. |
| `preamble-requires-ref-description` | Proposals mentioned in the `description` header appear in the `requires` header. |
| `preamble-requires-ref-title` | Proposals mentioned in the `title` header appear in the `requires` header. |
| `preamble-requires-status` | arcs listed in `requires` have statuses further along than the current proposal. |
Expand Down
2 changes: 1 addition & 1 deletion arcw-lint-js/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "arcw-lint-js"
version = "0.1.12"
version = "0.1.14"
edition = "2021"
license = "MPL-2.0"
rust-version = "1.60"
Expand Down
2 changes: 1 addition & 1 deletion arcw-lint-js/tests/arcs/arc-0020.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
status: Draft
status: Final
---

5 changes: 2 additions & 3 deletions arcw-lint-js/tests/arcs/arc-1000.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ title: A sample proposal
description: This proposal is a sample that should be considered
author: John Doe (@johndoe), Jenny Doe <[email protected]>
discussions-to: https://github.com/algorandfoundation/ARCs/issues/
status: Last Call
last-call-deadline: 2020-01-01
status: Withdrawn
type: Standards Track
category: Core
created: 2020-01-01
requires: 20
withdrawal-reason: not good
---

## Abstract
Expand Down
25 changes: 23 additions & 2 deletions arcw-lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ pub fn default_lints() -> impl Iterator<Item = (&'static str, Box<dyn Lint>)> {
}
.boxed(),
),
(
"preamble-len-withdrawal-reason",
preamble::Length {
name: "withdrawal-reason",
min: Some(2),
max: Some(140),
}
.boxed(),
),
(
"preamble-req",
preamble::Required(&[
Expand Down Expand Up @@ -168,6 +177,8 @@ pub fn default_lints() -> impl Iterator<Item = (&'static str, Box<dyn Lint>)> {
"created",
"requires",
"withdrawal-reason",
"replaces",
"superseded-by",
])
.boxed(),
),
Expand Down Expand Up @@ -203,6 +214,15 @@ pub fn default_lints() -> impl Iterator<Item = (&'static str, Box<dyn Lint>)> {
}
.boxed(),
),
(
"preamble-req-superseded-by",
preamble::RequiredIfEq {
when: "status",
equals: "Deprecated",
then: "superseded-by",
}
.boxed(),
),
(
"preamble-enum-status",
preamble::OneOf {
Expand All @@ -214,6 +234,7 @@ pub fn default_lints() -> impl Iterator<Item = (&'static str, Box<dyn Lint>)> {
"Final",
"Stagnant",
"Withdrawn",
"Deprecated",
"Living",
],
}
Expand Down Expand Up @@ -244,7 +265,7 @@ pub fn default_lints() -> impl Iterator<Item = (&'static str, Box<dyn Lint>)> {
&["Draft", "Stagnant"],
&["Review"],
&["Last Call"],
&["Final", "Withdrawn", "Living"],
&["Final", "Withdrawn", "Living","Deprecated"],
]
}.boxed(),
),
Expand Down Expand Up @@ -328,7 +349,7 @@ pub fn default_lints() -> impl Iterator<Item = (&'static str, Box<dyn Lint>)> {
&["Draft", "Stagnant"],
&["Review"],
&["Last Call"],
&["Final", "Withdrawn", "Living"],
&["Final", "Withdrawn", "Living","Deprecated"],
]
}.boxed(),
)
Expand Down
39 changes: 39 additions & 0 deletions arcw-lint/tests/arcv/preamble-status-deprecated/input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
arc: 1
title: A sample proposal
description: A sample description
author: John Doe (@johndoe)
discussions-to: https://github.com/algorandfoundation/ARCs/issues/
status: Deprecated
type: Standards Track
category: Core
created: 2020-01-01
deprecated-reason: New ARC is better
---

## Abstract
This is the abstract for the arc.

## Motivation
This is the motivation for the arc.

## Specification
This is the specification for the arc.

## Rationale
This is the rationale for the arc.

## Backwards Compatibility
These are the backwards compatibility concerns for the arc.

## Test Cases
These are the test cases for the arc.

## Reference Implementation
This is the implementation for the arc.

## Security Considerations
These are the security considerations for the arc.

## Copyright
Copyright and related rights waived via [CC0](../LICENSE.md).
Empty file.
2 changes: 1 addition & 1 deletion arcw-lint/tests/arcv/preamble-status-invalid/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ error[preamble-enum-status]: preamble header `status` has an unrecognized value
--> input.md:7:8
|
7 | status: Invalid
| ^^^^^^^^ must be one of: `Draft`, `Review`, `Last Call`, `Final`, `Stagnant`, `Withdrawn`, `Living`
| ^^^^^^^^ must be one of: `Draft`, `Review`, `Last Call`, `Final`, `Stagnant`, `Withdrawn`, `Living`, `Deprecated`
|

0 comments on commit a069464

Please sign in to comment.