diff mbox series

[1/3] suricatta/lua: Update specification

Message ID 20240221180540.37058-1-michael.adler@siemens.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series [1/3] suricatta/lua: Update specification | expand

Commit Message

Michael Adler Feb. 21, 2024, 6:05 p.m. UTC
From: Christian Storm <christian.storm@siemens.com>

LuaLS recently implemented stricter inference checks.
Adapt the Suricatta Lua Module Interface Specification.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
Signed-off-by: Michael Adler <michael.adler@siemens.com>
---
 suricatta/suricatta.lua | 70 ++++++++++++++++++++---------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

Comments

Stefano Babic Feb. 29, 2024, 8:46 a.m. UTC | #1
On 21.02.24 19:05, 'Michael Adler' via swupdate wrote:
> From: Christian Storm <christian.storm@siemens.com>
>
> LuaLS recently implemented stricter inference checks.
> Adapt the Suricatta Lua Module Interface Specification.
>
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> Signed-off-by: Michael Adler <michael.adler@siemens.com>
> ---
>   suricatta/suricatta.lua | 70 ++++++++++++++++++++---------------------
>   1 file changed, 35 insertions(+), 35 deletions(-)
>
> diff --git a/suricatta/suricatta.lua b/suricatta/suricatta.lua
> index 6a4fa131..303e8639 100644
> --- a/suricatta/suricatta.lua
> +++ b/suricatta/suricatta.lua
> @@ -77,11 +77,6 @@ suricatta.bootloader = {
>           GRUB  = "grub",
>           UBOOT = "uboot",
>       },
> -
> -    --- Operations on the currently set bootloader's environment.
> -    --
> -    --- @class suricatta.bootloader.env
> -    env = {}
>   }
>
>   --- Get currently set bootloader's name.
> @@ -95,6 +90,11 @@ suricatta.bootloader.get = function() end
>   --- @return boolean                                    # True if `name` is currently set bootloader, false otherwise
>   suricatta.bootloader.is = function(name) end
>
> +--- Operations on the currently set bootloader's environment.
> +--
> +--- @class suricatta.bootloader.env
> +suricatta.bootloader.env = {}
> +
>   --- Get value of a bootloader environment variable.
>   --
>   --- @param  variable  string  Name of the bootloader environment variable to get value for
> @@ -222,33 +222,33 @@ suricatta.channel = {
>       --- Channel options as in `include/channel_curl.h`.
>       --
>       --- @class suricatta.channel.options
> -    --- @field url                 string   `CURLOPT_URL` - URL for this transfer
> -    --- @field cached_file         string   Resume download from cached file at path
> -    --- @field auth                string   `CURLOPT_USERPWD` - user name and password to use in authentication
> -    --- @field request_body        string   Data to send to server for `PUT` and `POST`
> -    --- @field iface               string   `CURLOPT_INTERFACE` - source interface for outgoing traffic
> -    --- @field dry_run             boolean  `swupdate_request`'s dry_run field as in `include/network_ipc.h`
> -    --- @field cafile              string   `CURLOPT_CAINFO` - path to Certificate Authority (CA) bundle
> -    --- @field sslkey              string   `CURLOPT_SSLKEY` - private key file for TLS and SSL client cert
> -    --- @field sslcert             string   `CURLOPT_SSLCERT` - SSL client certificate
> -    --- @field ciphers             string   `CURLOPT_SSL_CIPHER_LIST` - ciphers to use for TLS
> -    --- @field proxy               string   `CURLOPT_PROXY` - proxy to use
> -    --- @field info                string   `swupdate_request`'s info field as in `include/network_ipc.h`
> -    --- @field auth_token          string   String appended to Header
> -    --- @field content_type        string   `Content-Type:` and `Accept:` appended to Header
> -    --- @field retry_sleep         number   Time to wait prior to retry and resume a download
> -    --- @field method              suricatta.channel.method  Channel transfer method to use
> -    --- @field retries             number   Maximal download attempt count
> -    --- @field low_speed_timeout   number   `CURLOPT_LOW_SPEED_TIME` - low speed limit time period
> -    --- @field connection_timeout  number   `CURLOPT_CONNECTTIMEOUT` - timeout for the connect phase
> -    --- @field format              suricatta.channel.content  Content type passed over the channel
> -    --- @field debug               boolean  Set channel debug logging
> -    --- @field usessl              boolean  Enable SSL hash sum calculation
> -    --- @field strictssl           boolean  `CURLOPT_SSL_VERIFYHOST` + `CURLOPT_SSL_VERIFYPEER`
> -    --- @field nocheckanswer       boolean  Whether the reply is interpreted/logged and tried to be parsed
> -    --- @field nofollow            boolean  `CURLOPT_FOLLOWLOCATION` - follow HTTP 3xx redirects
> -    --- @field max_download_speed  string   `CURLOPT_MAX_RECV_SPEED_LARGE` - rate limit data download speed
> -    --- @field headers_to_send     table<string, string>  Header to send
> +    --- @field url                 string | nil   `CURLOPT_URL` - URL for this transfer
> +    --- @field cached_file         string | nil   Resume download from cached file at path
> +    --- @field auth                string | nil   `CURLOPT_USERPWD` - user name and password to use in authentication
> +    --- @field request_body        string | nil   Data to send to server for `PUT` and `POST`
> +    --- @field iface               string | nil   `CURLOPT_INTERFACE` - source interface for outgoing traffic
> +    --- @field dry_run             boolean | nil  `swupdate_request`'s dry_run field as in `include/network_ipc.h`
> +    --- @field cafile              string | nil   `CURLOPT_CAINFO` - path to Certificate Authority (CA) bundle
> +    --- @field sslkey              string | nil   `CURLOPT_SSLKEY` - private key file for TLS and SSL client cert
> +    --- @field sslcert             string | nil   `CURLOPT_SSLCERT` - SSL client certificate
> +    --- @field ciphers             string | nil   `CURLOPT_SSL_CIPHER_LIST` - ciphers to use for TLS
> +    --- @field proxy               string | nil   `CURLOPT_PROXY` - proxy to use
> +    --- @field info                string | nil   `swupdate_request`'s info field as in `include/network_ipc.h`
> +    --- @field auth_token          string | nil   String appended to Header
> +    --- @field content_type        string | nil   `Content-Type:` and `Accept:` appended to Header
> +    --- @field retry_sleep         number | nil   Time to wait prior to retry and resume a download
> +    --- @field method              suricatta.channel.method | nil  Channel transfer method to use
> +    --- @field retries             number | nil   Maximal download attempt count
> +    --- @field low_speed_timeout   number | nil   `CURLOPT_LOW_SPEED_TIME` - low speed limit time period
> +    --- @field connection_timeout  number | nil   `CURLOPT_CONNECTTIMEOUT` - timeout for the connect phase
> +    --- @field format              suricatta.channel.content | nil  Content type passed over the channel
> +    --- @field debug               boolean | nil  Set channel debug logging
> +    --- @field usessl              boolean | nil  Enable SSL hash sum calculation
> +    --- @field strictssl           boolean | nil  `CURLOPT_SSL_VERIFYHOST` + `CURLOPT_SSL_VERIFYPEER`
> +    --- @field nocheckanswer       boolean | nil  Whether the reply is interpreted/logged and tried to be parsed
> +    --- @field nofollow            boolean | nil  `CURLOPT_FOLLOWLOCATION` - follow HTTP 3xx redirects
> +    --- @field max_download_speed  string | nil   `CURLOPT_MAX_RECV_SPEED_LARGE` - rate limit data download speed
> +    --- @field headers_to_send     table<string, string> | nil  Header to send
>       options = {},
>
>       --- Open a new channel.
> @@ -267,9 +267,9 @@ suricatta.channel = {
>   -- and specific options to the download / installation operation, e.g., `drain_messages`.
>   --
>   --- @class suricatta.operation_channel
> ---- @field channel          suricatta.open_channel     Channel table as returned by `suricatta.channel.open()`
> ---- @field drain_messages?  boolean                    Whether to flush all progress messages or only those while in-flight operation (default)
> ---- @field ∈?               suricatta.channel.options  Channel options to override for this operation
> +--- @field channel          suricatta.open_channel           Channel table as returned by `suricatta.channel.open()`
> +--- @field drain_messages   boolean  | nil                   Whether to flush all progress messages or only those while in-flight operation (default)
> +--- @field ∈                suricatta.channel.options | nil  Channel options to override for this operation
>
>   --- Install an update artifact from remote server or local file.
>   --


Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/suricatta/suricatta.lua b/suricatta/suricatta.lua
index 6a4fa131..303e8639 100644
--- a/suricatta/suricatta.lua
+++ b/suricatta/suricatta.lua
@@ -77,11 +77,6 @@  suricatta.bootloader = {
         GRUB  = "grub",
         UBOOT = "uboot",
     },
-
-    --- Operations on the currently set bootloader's environment.
-    --
-    --- @class suricatta.bootloader.env
-    env = {}
 }
 
 --- Get currently set bootloader's name.
@@ -95,6 +90,11 @@  suricatta.bootloader.get = function() end
 --- @return boolean                                    # True if `name` is currently set bootloader, false otherwise
 suricatta.bootloader.is = function(name) end
 
+--- Operations on the currently set bootloader's environment.
+--
+--- @class suricatta.bootloader.env
+suricatta.bootloader.env = {}
+
 --- Get value of a bootloader environment variable.
 --
 --- @param  variable  string  Name of the bootloader environment variable to get value for
@@ -222,33 +222,33 @@  suricatta.channel = {
     --- Channel options as in `include/channel_curl.h`.
     --
     --- @class suricatta.channel.options
-    --- @field url                 string   `CURLOPT_URL` - URL for this transfer
-    --- @field cached_file         string   Resume download from cached file at path
-    --- @field auth                string   `CURLOPT_USERPWD` - user name and password to use in authentication
-    --- @field request_body        string   Data to send to server for `PUT` and `POST`
-    --- @field iface               string   `CURLOPT_INTERFACE` - source interface for outgoing traffic
-    --- @field dry_run             boolean  `swupdate_request`'s dry_run field as in `include/network_ipc.h`
-    --- @field cafile              string   `CURLOPT_CAINFO` - path to Certificate Authority (CA) bundle
-    --- @field sslkey              string   `CURLOPT_SSLKEY` - private key file for TLS and SSL client cert
-    --- @field sslcert             string   `CURLOPT_SSLCERT` - SSL client certificate
-    --- @field ciphers             string   `CURLOPT_SSL_CIPHER_LIST` - ciphers to use for TLS
-    --- @field proxy               string   `CURLOPT_PROXY` - proxy to use
-    --- @field info                string   `swupdate_request`'s info field as in `include/network_ipc.h`
-    --- @field auth_token          string   String appended to Header
-    --- @field content_type        string   `Content-Type:` and `Accept:` appended to Header
-    --- @field retry_sleep         number   Time to wait prior to retry and resume a download
-    --- @field method              suricatta.channel.method  Channel transfer method to use
-    --- @field retries             number   Maximal download attempt count
-    --- @field low_speed_timeout   number   `CURLOPT_LOW_SPEED_TIME` - low speed limit time period
-    --- @field connection_timeout  number   `CURLOPT_CONNECTTIMEOUT` - timeout for the connect phase
-    --- @field format              suricatta.channel.content  Content type passed over the channel
-    --- @field debug               boolean  Set channel debug logging
-    --- @field usessl              boolean  Enable SSL hash sum calculation
-    --- @field strictssl           boolean  `CURLOPT_SSL_VERIFYHOST` + `CURLOPT_SSL_VERIFYPEER`
-    --- @field nocheckanswer       boolean  Whether the reply is interpreted/logged and tried to be parsed
-    --- @field nofollow            boolean  `CURLOPT_FOLLOWLOCATION` - follow HTTP 3xx redirects
-    --- @field max_download_speed  string   `CURLOPT_MAX_RECV_SPEED_LARGE` - rate limit data download speed
-    --- @field headers_to_send     table<string, string>  Header to send
+    --- @field url                 string | nil   `CURLOPT_URL` - URL for this transfer
+    --- @field cached_file         string | nil   Resume download from cached file at path
+    --- @field auth                string | nil   `CURLOPT_USERPWD` - user name and password to use in authentication
+    --- @field request_body        string | nil   Data to send to server for `PUT` and `POST`
+    --- @field iface               string | nil   `CURLOPT_INTERFACE` - source interface for outgoing traffic
+    --- @field dry_run             boolean | nil  `swupdate_request`'s dry_run field as in `include/network_ipc.h`
+    --- @field cafile              string | nil   `CURLOPT_CAINFO` - path to Certificate Authority (CA) bundle
+    --- @field sslkey              string | nil   `CURLOPT_SSLKEY` - private key file for TLS and SSL client cert
+    --- @field sslcert             string | nil   `CURLOPT_SSLCERT` - SSL client certificate
+    --- @field ciphers             string | nil   `CURLOPT_SSL_CIPHER_LIST` - ciphers to use for TLS
+    --- @field proxy               string | nil   `CURLOPT_PROXY` - proxy to use
+    --- @field info                string | nil   `swupdate_request`'s info field as in `include/network_ipc.h`
+    --- @field auth_token          string | nil   String appended to Header
+    --- @field content_type        string | nil   `Content-Type:` and `Accept:` appended to Header
+    --- @field retry_sleep         number | nil   Time to wait prior to retry and resume a download
+    --- @field method              suricatta.channel.method | nil  Channel transfer method to use
+    --- @field retries             number | nil   Maximal download attempt count
+    --- @field low_speed_timeout   number | nil   `CURLOPT_LOW_SPEED_TIME` - low speed limit time period
+    --- @field connection_timeout  number | nil   `CURLOPT_CONNECTTIMEOUT` - timeout for the connect phase
+    --- @field format              suricatta.channel.content | nil  Content type passed over the channel
+    --- @field debug               boolean | nil  Set channel debug logging
+    --- @field usessl              boolean | nil  Enable SSL hash sum calculation
+    --- @field strictssl           boolean | nil  `CURLOPT_SSL_VERIFYHOST` + `CURLOPT_SSL_VERIFYPEER`
+    --- @field nocheckanswer       boolean | nil  Whether the reply is interpreted/logged and tried to be parsed
+    --- @field nofollow            boolean | nil  `CURLOPT_FOLLOWLOCATION` - follow HTTP 3xx redirects
+    --- @field max_download_speed  string | nil   `CURLOPT_MAX_RECV_SPEED_LARGE` - rate limit data download speed
+    --- @field headers_to_send     table<string, string> | nil  Header to send
     options = {},
 
     --- Open a new channel.
@@ -267,9 +267,9 @@  suricatta.channel = {
 -- and specific options to the download / installation operation, e.g., `drain_messages`.
 --
 --- @class suricatta.operation_channel
---- @field channel          suricatta.open_channel     Channel table as returned by `suricatta.channel.open()`
---- @field drain_messages?  boolean                    Whether to flush all progress messages or only those while in-flight operation (default)
---- @field ∈?               suricatta.channel.options  Channel options to override for this operation
+--- @field channel          suricatta.open_channel           Channel table as returned by `suricatta.channel.open()`
+--- @field drain_messages   boolean  | nil                   Whether to flush all progress messages or only those while in-flight operation (default)
+--- @field ∈                suricatta.channel.options | nil  Channel options to override for this operation
 
 --- Install an update artifact from remote server or local file.
 --