From e605a2391ad4bfe08cee9bc3cbca68e9e3b6b0fb Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 15 Feb 2022 10:49:11 -0500 Subject: [PATCH 1/2] doc: Update documentation to state new code must use latest approved methods Signed-off-by: Donald Sharp --- doc/developer/workflow.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index 45bee17b7..1994714bc 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -346,6 +346,13 @@ Pre-submission Checklist the new feature within our existing CI infrastructure. Also the addition of automated testing to cover any pull request is encouraged. +- All new code must use the current latest version of acceptable code. + + - If a daemon is converted to YANG, then new code must use YANG. + - DEFPY's must be used for new cli + - Typesafe lists must be used + - printf formatting changes must be used + .. _signing-off: Signing Off From 264274daed4b384f0d86f855fdc7be289006a893 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 15 Feb 2022 12:29:45 -0500 Subject: [PATCH 2/2] doc: List DEFUN as deprecated New development should use DEFPY. Document this Signed-off-by: Donald Sharp --- doc/developer/cli.rst | 10 ++++++++++ doc/developer/workflow.rst | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/developer/cli.rst b/doc/developer/cli.rst index 9254eb473..ff6c4f6e1 100644 --- a/doc/developer/cli.rst +++ b/doc/developer/cli.rst @@ -48,6 +48,16 @@ a node and returns the parent of the node. This interface causes all manner of insidious problems, even for experienced developers, and needs to be fixed at some point in the future. +Deprecation of old style of commands +------------------------------------ + +There are currently 2 styles of defining commands within a FRR source file. +``DEFUN`` and ``DEFPY``. ``DEFPY`` should be used for all new commands that +a developer is writing. This is because it allows for much better handling +of command line arguments as well as ensuring that input is correct. ``DEFUN`` +is listed here for historical reasons as well as for ensuring that existing +code can be understood by new developers. + Defining Commands ----------------- All definitions for the CLI system are exposed in ``lib/command.h``. In this diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index 1994714bc..af8756a90 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -1257,8 +1257,8 @@ CLI changes ----------- CLI's are a complicated ugly beast. Additions or changes to the CLI should use -a DEFUN to encapsulate one setting as much as is possible. Additionally as new -DEFUN's are added to the system, documentation should be provided for the new +a DEFPY to encapsulate one setting as much as is possible. Additionally as new +DEFPY's are added to the system, documentation should be provided for the new commands. Backwards Compatibility