Skip to content

Commit 8f01c7b

Browse files
authored
[pre-commit] Fix style issues in files under the docs folder (sonic-net#6647)
What is the motivation for this PR? pre-commit is a static analysis tool introduced recently. This tool is not able to do diff-only check. It checks the whole files touched by PR. We can't blame PR author for legacy issues. That's why currently the pre-commit check is only optional. To ensure that we can make pre-commit a mandatory check for PRs submitted to this repository, we need to fix all the legacy issues complained by pre-commit. How did you do it? This change fixed all pre-commit issues in files under the `docs` folder. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
1 parent 55b2f71 commit 8f01c7b

File tree

250 files changed

+413
-453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+413
-453
lines changed

docs/ECN-test-plan.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ The test cases depicted in this document aim to do functional testing of ECN beh
4444
### Testbed
4545

4646
```
47-
+-------------+ +--------------+ +-------------+
48-
| Keysight TX |------| SONiC DUT |------| Keysight RX |
49-
+-------------+ +--------------+ +-------------+
47+
+-------------+ +--------------+ +-------------+
48+
| Keysight TX |------| SONiC DUT |------| Keysight RX |
49+
+-------------+ +--------------+ +-------------+
5050
5151
Keysight ports are connected via SONiC switch as shown in the illustration above.
5252
```
@@ -126,7 +126,7 @@ This test aims to verify the DUT’s ECN marking accuracy, e.g., if the actual E
126126
2. PFC PAUSE storm: Persistent PFC pause frames from the Keysight
127127
Rx port to the Keysight Tx port. The priorities of PFC pause
128128
frames should be the same as that of 'Test data traffic'. And the
129-
inter-frame transmission interval should be lesser than the
129+
inter-frame transmission interval should be lesser than the
130130
per-frame pause duration.
131131

132132
#### Test Steps
@@ -144,4 +144,4 @@ This test aims to verify the DUT’s ECN marking accuracy, e.g., if the actual E
144144
* For the next (Kmax-Kmin) packets, Kmin <= q < Kmax, so their theoretical ECN marking probability should be no larger than Pmax%. As q varies from Kmax to Kmin, the ECN marking probability varies linearly from Pmax to 0.
145145
* For the last Kmin packets, q<Kmin. So, none of them should be ECN marked.
146146
7. Repeat steps 1 to 5 at least 200 times.
147-
8. After 200 iterations, compare between theoretical probability of ECN marking with the actual ECN marking yielded as test results against queue length.
147+
8. After 200 iterations, compare between theoretical probability of ECN marking with the actual ECN marking yielded as test results against queue length.

docs/api_wiki/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_fun(duthosts, rand_one_dut_hostname, ptfhost):
1919
2020
# example dut api call
2121
duthost.get_extended_minigraph_facts()
22-
22+
2323
# example ptf api call
2424
ptfhost.shell("ls")
2525
```
@@ -318,7 +318,7 @@ def test_fun(duthosts, rand_one_dut_hostname, ptfhost):
318318

319319
- [get_vtysh_cmd_for_namespace](multi_asic_methods/get_vtysh_cmd_for_namespace.md) - Provides modified VTYSH command provided ASIC namespace and command.
320320

321-
- [has_config_subcommand](multi_asic_methods/has_config_subcommand.md) - Check if a config or show subcommand exists on the remote host. *WARNING*: to test whether it exists, the method will run the command. Ensure that there will be no negative sid-effects of having this command run on
321+
- [has_config_subcommand](multi_asic_methods/has_config_subcommand.md) - Check if a config or show subcommand exists on the remote host. *WARNING*: to test whether it exists, the method will run the command. Ensure that there will be no negative sid-effects of having this command run on
322322
the remote host.
323323

324324
- [is_bgp_state_idle](multi_asic_methods/is_bgp_state_idle.md) - Checks if all BGP peers are in IDLE state on the sonichost.

docs/api_wiki/ansible_methods/announce_routes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def test_fun(localhost):
2525
- Type: `String`
2626

2727
## Expected Output
28-
Provides no meaningful output
28+
Provides no meaningful output

docs/api_wiki/ansible_methods/bgp_facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ Returns dictionary with information on BGP configuration. The dictionary hierarc
7070
- `mrai` - Minimal route advertisement interval
7171
- `ip_version`: type of ip version for neighbor
7272
- `local AS`: local AS number
73-
- `remote routerid`
73+
- `remote routerid`

docs/api_wiki/ansible_methods/bgp_route.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_fun(duthosts, rand_one_dut_hostname, tbinfo):
2020

2121
- `direction` - to restict retrieving bgp neighbor advertise or received routes
2222
- Required: `False`, unless `neighbor` argument is provided.
23-
- Choices:
23+
- Choices:
2424
- `adv` - Advertising
2525
- `rec` - Receiving
2626
- Type: `String`
@@ -46,4 +46,3 @@ Returns a dictionary containing information on the bgp route given the provided
4646
- `weigh` - tie breaker used to determine best path
4747
- `nexthop` - nexthop configured for neighbor
4848
- `aspath` - aspath configured for neighbor
49-

docs/api_wiki/ansible_methods/command.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_fun(duthosts, rand_one_dut_hostname):
2727
- Required: `True` if `cmd` or free-form argument is not provided, `False` otherwise.
2828
- Type: `List`
2929
- Element-Type: `String`
30-
- `chdir` - change into specified directory before running
30+
- `chdir` - change into specified directory before running
3131
- Required: `False`
3232
- Type: `String`
3333
- `cmd` - The command to be run as a string with space dilineated options.
@@ -67,4 +67,4 @@ Dictionary with information on command output:
6767
- `stderr` - The standard error as a string
6868
- `stderr_lines`- The standard error as a list of strings
6969
- `stdout` - the standard output as a string
70-
- `stdout_lines` - the standard output as a list of strings
70+
- `stdout_lines` - the standard output as a list of strings

docs/api_wiki/ansible_methods/config_facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
3535

3636
## Expected Output
3737

38-
Output is too long to reasonably document on this page. Though documentation should be added on commonly used features.
38+
Output is too long to reasonably document on this page. Though documentation should be added on commonly used features.

docs/api_wiki/ansible_methods/conn_graph_facts.md

-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,3 @@ def test_fun(localhost):
4646
- `device_console_link` - The console server port connected to the device
4747
- `device_pdu_info` - The device's pdu server type, mgmtip, hwsku and protocol
4848
- `device_pdu_links` - The pdu server ports connected to the device
49-

docs/api_wiki/ansible_methods/console_facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
2020
This method takes no arguments
2121

2222
## Expected Output
23-
Was not able to get sufficient output with my testbed. If you are contributor with console enabled, consider contributing your output.
23+
Was not able to get sufficient output with my testbed. If you are contributor with console enabled, consider contributing your output.

docs/api_wiki/ansible_methods/copy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_fun(duthosts, rand_one_dut_hostname):
4545
- `owner` - Name of use that should own file/directory
4646
- Required: `False`
4747
- Type: `String`
48-
- `remote_src` - Whether `src` is on the remote host or on the calling device.
48+
- `remote_src` - Whether `src` is on the remote host or on the calling device.
4949
- Required: `False`
5050
- Type: `Boolean`
5151
- Default: `False`
@@ -84,4 +84,4 @@ Returns dictionary that provides info on the copied file.
8484
- `size` - size of copied file
8585
- `src` - source file was copied from
8686
- `state` - staet of the copied file (`file`, `directory`)
87-
- `uid` - Owner id for the file
87+
- `uid` - Owner id for the file

docs/api_wiki/ansible_methods/exabgp.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Start or stop exabgp instance with certain configurations
1111
## Examples
1212
```
1313
def test_fun(ptfhost):
14-
ptfhost.exabgp(name="t1",
15-
state="started",
14+
ptfhost.exabgp(name="t1",
15+
state="started",
1616
router_id="10.0.0.0",
1717
local_ip="10.0.0.0",
1818
peer_ip="10.0.0.1",
@@ -65,4 +65,4 @@ def test_fun(ptfhost):
6565
- Default: `False`
6666

6767
## Expected Output
68-
No useful output is returned.
68+
No useful output is returned.

docs/api_wiki/ansible_methods/extract_log.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
3535
- Default: `None`
3636

3737
## Expected Output
38-
Provides no output
38+
Provides no output

docs/api_wiki/ansible_methods/feature_facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Returns a dictionary with information on the features. The dictionary hierarchy
2424

2525
- `ansible_facts`
2626
- `feature_facts`
27-
- `{FEATURE_NAME}` - `enabled`\\`disabled`
27+
- `{FEATURE_NAME}` - `enabled`\\`disabled`

docs/api_wiki/ansible_methods/fetch.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- [Expected Output](#expected-output)
77

88
## Overview
9-
Copies file from remote host to local host.
9+
Copies file from remote host to local host.
1010

1111
This method may not perform as expected. Given a remote src, a local dest, and the hostname of the remote device, the final location will look like this on the local machine:
1212

@@ -43,4 +43,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
4343
- Default: `True`
4444

4545
## Expected Output
46-
This method provides no useful output.
46+
This method provides no useful output.

docs/api_wiki/ansible_methods/file.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
9393
Dictionary with basic information.
9494

9595
- `dest` - destination of path
96-
- `path` - destination of path
96+
- `path` - destination of path

docs/api_wiki/ansible_methods/find.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ Returns dictionary that provides information on the process as well as stats on
102102

103103
- `examined` - Number of files examined
104104
- `matched` - Number of files matched
105-
- `files` - List of dictionaries corresponding to each matched file. For description of dictionary, see output of [duthost.stat](stat.md)
105+
- `files` - List of dictionaries corresponding to each matched file. For description of dictionary, see output of [duthost.stat](stat.md)

docs/api_wiki/ansible_methods/get_ip_in_range.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Returns dictionary containing generated ips. The dictionary hierarchy is describ
4040
- `ansible_facts`
4141
- `generated_ips` - list of generated ips
4242

43-
(u'ansible_facts', {u'generated_ips': [u'192.168.0.1/21', u'192.168.0.2/21']})
43+
(u'ansible_facts', {u'generated_ips': [u'192.168.0.1/21', u'192.168.0.2/21']})

docs/api_wiki/ansible_methods/image_facts.md

-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ A dictionary is returned with information on the remote host's laoded image. The
2727
- `available` - List of available images
2828
- `current` - Currently loaded image
2929
- `next` - latest available image
30-

docs/api_wiki/ansible_methods/interface_facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ Returns a dictionary with information on interfaces. The dictionary hierarchy is
4242
- `scope`
4343
- `prefix` - address prefix
4444
- `active` - Whether or not interface is active
45-
- `type` - type of interface
45+
- `type` - type of interface

docs/api_wiki/ansible_methods/lldp_facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ def test_fun(localhost, duthosts, rand_one_dut_hostname):
6161
## Expected Output
6262

6363
# TODO
64-
Unable to test output. Timeout on my system due to it being slow.
64+
Unable to test output. Timeout on my system due to it being slow.

docs/api_wiki/ansible_methods/minigraph_facts.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ A dictionary would be returned containing info on the minigraph. The dictionary
107107
- `mgmt_addr` - mgmt address for specified device
108108
- `hwsku` - Type of hardware switch being used
109109
- `type` - type of device
110-
110+
111111
- `minigraph_bgp_asn` - BGP asn configured by minigraph
112112
- `minigraph_neighbors` - provides information on neighbor ports
113113
- `{PORT_NAME}` - Dictionary providing information on port
@@ -120,4 +120,4 @@ A dictionary would be returned containing info on the minigraph. The dictionary
120120
- `mask` - subnet mask
121121
- `addr` - address configured for interface
122122
- `attachto` - name of VLAN interface is attached to
123-
- `minigraph_hwsku` - type of hardware switch being used by `minigraph_hostname`
123+
- `minigraph_hwsku` - type of hardware switch being used by `minigraph_hostname`

docs/api_wiki/ansible_methods/monit_process.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_fun(duthosts, rand_one_dut_hostname):
2828
- Default: `12`
2929

3030
## Expected Output
31-
Dictionary describing the cpu and memory usage of all processes. The dictionary hierarchy is described below, with each indentation describing a sub-dictionary:
31+
Dictionary describing the cpu and memory usage of all processes. The dictionary hierarchy is described below, with each indentation describing a sub-dictionary:
3232

3333
- `monit_results` - List of dictionaries, where each dictionary refers to a separate process
3434
- `status` - Whether process is runing or not

docs/api_wiki/ansible_methods/ping.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
2525
## Expected Output
2626
Dictionary with value returned from host.
2727

28-
- `ping` - Value returned from host
28+
- `ping` - Value returned from host

docs/api_wiki/ansible_methods/port_alias.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ Returns dictionary with port aliases and port speeds. The dictionary hierarchy i
4444
- `ansible_facts` - Dictionary containing port info
4545
- `port_alias` - list of port aliases
4646
- `port_speed` - Dictionary that maps aliases to thier speed
47-
- `{PORT_ALIAS}` - speed of specified port
47+
- `{PORT_ALIAS}` - speed of specified port

docs/api_wiki/ansible_methods/reduce_and_add_sonic_images.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ duthost.reduce_and_add_sonic_images(new_image_url={URL_TO_SONIC_IMAGE})
2525
Simple dictionary showing which image was downloaded. The dictionary hierarchy is described below, with each indentation describing a sub-dictionary:
2626

2727
- `ansible_facts`
28-
- `downlaoded_iamge_version` - version of image downloaded
28+
- `downlaoded_iamge_version` - version of image downloaded

docs/api_wiki/ansible_methods/replace.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## Overview
99
Replaces all instances of a pattern within a specified file. When using this method make sure that the pattern being used to match does not match the replacement text, otherwise the results may be undesirable.
1010

11-
[docs](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/replace_module.html) used to help generate this page.
11+
[docs](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/replace_module.html) used to help generate this page.
1212

1313
## Examples
1414
```
@@ -78,4 +78,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
7878
- Type: `Boolean`
7979

8080
## Expected Output
81-
Method provides no useful output.
81+
Method provides no useful output.

docs/api_wiki/ansible_methods/service.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
5050
- Default: `auto`
5151

5252
## Expected Output
53-
Provides no useful output. Will error if bad args are provided.
53+
Provides no useful output. Will error if bad args are provided.

docs/api_wiki/ansible_methods/setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ This method takes no arguments
2323

2424
## Expected Output
2525

26-
The output for this command is far too long to reasonably document. Commonly used properties should be documented at some point.
26+
The output for this command is far too long to reasonably document. Commonly used properties should be documented at some point.

docs/api_wiki/ansible_methods/shell.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- [Expected Output](#expected-output)
77

88
## Overview
9-
Runs commands on the remote host.
9+
Runs commands on the remote host.
1010

1111
Similar to [command](command.md) except that it runs commands through a shell `/bin/sh`.
1212

@@ -56,4 +56,4 @@ Dictionary with information on command output:
5656
- `stderr` - The standard error as a string
5757
- `stderr_lines`- The standard error as a list of strings
5858
- `stdout` - the standard output as a string
59-
- `stdout_lines` - the standard output as a list of strings
59+
- `stdout_lines` - the standard output as a list of strings

docs/api_wiki/ansible_methods/shell_cmds.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ A dictionary with results from commands run. The dictionary hierarchy is describ
3939
- `stdout_lines` - What was printed to stdout (split by line) during execution of command
4040
- `stdout` - What was printed to stdout (as one string) during execution of command
4141
- `cmd` - command that was run
42-
- `rc` - return code
42+
- `rc` - return code

docs/api_wiki/ansible_methods/show_interface.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_fun(duthosts, rand_one_dut_hostname):
3939
- Default: `False`
4040

4141
## Expected Output
42-
Will return a dictionary describing either status or counters depending on argument provided.
42+
Will return a dictionary describing either status or counters depending on argument provided.
4343

4444
### status
4545

@@ -69,4 +69,4 @@ The dictionary hierarchy is described below, with each indentation describing a
6969
- `TX_OK` - Packets correctly transmitted
7070
- `TX_ERR` - Packets incorrectly transmitted
7171
- `TX_DRP` - Dropped Packets transmitted
72-
- `TX_OVR` - Packets unable to be transmitted
72+
- `TX_OVR` - Packets unable to be transmitted

docs/api_wiki/ansible_methods/show_ip_interface.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ Provides a dictionary with information on the interfaces. The dictionary hierarc
3131
- `ipv4` - interface configured ipv4 address
3232
- `peer_ipv4` - BGP neighbor ipv4 address
3333
- `admin` - admin state
34-
- `oper_state` - operator state
35-
- `prefix_len` - interface prefix length
34+
- `oper_state` - operator state
35+
- `prefix_len` - interface prefix length

docs/api_wiki/ansible_methods/sonic_pfc_counters.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ Returns dictionary with information on interfaces and their counters. The dictio
3030
- `ansible_facts`
3131
- `{INTERFACE_NAME}` - Dictionary with counters for specified interface
3232
- `Rx` - list of counters for recieved packets
33-
- `Tx` - list of counters for transmitted packets
33+
- `Tx` - list of counters for transmitted packets

docs/api_wiki/ansible_methods/stat.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ Returns dictionary of stats regarding the provided file (whether or not the file
114114
- `wusr` - Whether owner can write to file
115115
- `xgrp` - Whether owner group can execute file
116116
- `xoth` - Whether others can execute file
117-
- `xusr` - Whether owner can execute file
117+
- `xusr` - Whether owner can execute file

docs/api_wiki/ansible_methods/switch_arptable.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ Returns a dictionary that describes the contents of the ARP table. The dictionar
3333
- `{IPV6_ADDRESS}` - dictionary containing information on entry associated with provided address
3434
- `interface` - name of interface associated with address
3535
- `macaddress` - macaddress for entry
36-
- `state` - state of interface
36+
- `state` - state of interface

docs/api_wiki/ansible_methods/sysfs_facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
2525
## Expected Output
2626

2727
## TODO
28-
Was not able to run on local machine.
28+
Was not able to run on local machine.

docs/api_wiki/ansible_methods/tempfile.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
3939
## Expected Output
4040
Dictionary that just has the path to the temp file on the remote host.
4141

42-
- `path` - path to created temp file or directory
42+
- `path` - path to created temp file or directory

docs/api_wiki/multi_asic_methods/asic_instance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def test_fun(duthosts, rand_one_dut_hostname, enum_frontend_asic_index):
2222
- Type: `Integer`
2323

2424
## Expected Output
25-
The ASIC instance corresponding to the provided ID.S
25+
The ASIC instance corresponding to the provided ID.S

docs/api_wiki/multi_asic_methods/asic_instance_from_namespace.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
2727
- Default: `$DEFAULT_NAMESPACE`
2828

2929
## Expected Output
30-
An ASIC instance corresponding to provided `namespace`
30+
An ASIC instance corresponding to provided `namespace`

docs/api_wiki/multi_asic_methods/asics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def test_fun(duthosts, rand_one_dut_hostname):
2222
This method takes no arguments
2323

2424
## Expected Output
25-
List of ASIC hosts.
25+
List of ASIC hosts.

0 commit comments

Comments
 (0)