Fix all Vale [error] level lint issues and all markdownlint issues (#997)
## Description * fixes all `markdownlint` issues, includeing autogenerated docs * fixes [error] level Vale problems * ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [x] 🗺️ Documentation - [ ] 🤖 Test - [ ] 💻 CI/Deployment - [x] 🐹 Trivial/Minor ## Issue(s) ## Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
b7db1e0912
commit
fe2516b9ba
@ -14,8 +14,13 @@ write-good.E-Prime = NO
|
|||||||
[*.md]
|
[*.md]
|
||||||
BasedOnStyles = Vale, Microsoft, proselint, write-good, alex
|
BasedOnStyles = Vale, Microsoft, proselint, write-good, alex
|
||||||
|
|
||||||
|
# Ignore the following blocks:
|
||||||
|
# - MDX code blocks - e.g. {mdx_code}
|
||||||
|
# - imports - e.g. import <something> from <something>;
|
||||||
|
# - corso command line examples first line in a bash code block starting with `corso`
|
||||||
BlockIgnores = (\{\#.*?\}), \
|
BlockIgnores = (\{\#.*?\}), \
|
||||||
(import.*?from.*?;)
|
(import.*?from.*?;),\
|
||||||
|
(?s) (```bash.*?corso.*?$)
|
||||||
|
|
||||||
[*.json]
|
[*.json]
|
||||||
BasedOnStyles = Vale
|
BasedOnStyles = Vale
|
||||||
|
|||||||
@ -30,7 +30,7 @@ This command starts a local development server within the Docker container and w
|
|||||||
make genclidocs
|
make genclidocs
|
||||||
```
|
```
|
||||||
|
|
||||||
Corso's CLI documents are auto-generated. This command explicitly triggers generating these docs. This step will happen
|
Corso's CLI documents are auto generated. This command explicitly triggers generating these docs. This step will happen
|
||||||
automatically for the other commands where this is relevant.
|
automatically for the other commands where this is relevant.
|
||||||
|
|
||||||
## Building static documentation
|
## Building static documentation
|
||||||
|
|||||||
@ -27,7 +27,7 @@ corso backup details exchange [flags]
|
|||||||
|`--event`||`[]`|Select backup details by event ID; accepts * to select all events|
|
|`--event`||`[]`|Select backup details by event ID; accepts * to select all events|
|
||||||
|`--event-calendar`||`[]`|Select backup details by event calendar ID; accepts * to select all events|
|
|`--event-calendar`||`[]`|Select backup details by event calendar ID; accepts * to select all events|
|
||||||
|`--event-organizer`|||Select backup details where the event organizer user id contains this value|
|
|`--event-organizer`|||Select backup details where the event organizer user id contains this value|
|
||||||
|`--event-recurs`|||Select backup details if the event recurs. Use --event-recurs false to select where the event does not recur.|
|
|`--event-recurs`|||Select backup details if the event recurs. Use `--event-recurs` false to select non-recurring events|
|
||||||
|`--event-starts-after`|||Select backup details where the event starts after this datetime|
|
|`--event-starts-after`|||Select backup details where the event starts after this datetime|
|
||||||
|`--event-starts-before`|||Select backup details where the event starts before this datetime|
|
|`--event-starts-before`|||Select backup details where the event starts before this datetime|
|
||||||
|`--event-subject`|||Select backup details where the event subject contains this value|
|
|`--event-subject`|||Select backup details where the event subject contains this value|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ corso restore exchange [flags]
|
|||||||
|`--event`||`[]`|Restore events by ID; accepts * to select all events|
|
|`--event`||`[]`|Restore events by ID; accepts * to select all events|
|
||||||
|`--event-calendar`||`[]`|Restore events by calendar ID; accepts * to select all event calendars|
|
|`--event-calendar`||`[]`|Restore events by calendar ID; accepts * to select all event calendars|
|
||||||
|`--event-organizer`|||Restore events where the event organizer user id contains this value|
|
|`--event-organizer`|||Restore events where the event organizer user id contains this value|
|
||||||
|`--event-recurs`|||Restore events if the event recurs. Use --event-recurs false to select where the event does not recur.|
|
|`--event-recurs`|||Restore events if the event recurs. Use `--event-recurs false` to select non-recurring events|
|
||||||
|`--event-starts-after`|||Restore events where the event starts after this datetime|
|
|`--event-starts-after`|||Restore events where the event starts after this datetime|
|
||||||
|`--event-starts-before`|||Restore events where the event starts before this datetime|
|
|`--event-starts-before`|||Restore events where the event starts before this datetime|
|
||||||
|`--event-subject`|||Restore events where the event subject contains this value|
|
|`--event-subject`|||Restore events where the event subject contains this value|
|
||||||
|
|||||||
@ -24,4 +24,4 @@ application to connect to your *M365 tenant* and transfer data during backup and
|
|||||||
*M365 Services* data. See [Repositories](/configuration/repos) for more information.
|
*M365 Services* data. See [Repositories](/configuration/repos) for more information.
|
||||||
|
|
||||||
* **Backup** is a copy of your *M365 Services* data to be used for restores in case of deletion, loss, or corruption of the
|
* **Backup** is a copy of your *M365 Services* data to be used for restores in case of deletion, loss, or corruption of the
|
||||||
original data. Corso performs backups incrementall, and each backup only captures data that has changed between backup iterations.
|
original data. Corso performs backups incrementally, and each backup only captures data that has changed between backup iterations.
|
||||||
|
|||||||
@ -16,10 +16,10 @@ The following steps outline a simplified procedure for creating an Azure Ad appl
|
|||||||
|
|
||||||
1. **Create a new application**
|
1. **Create a new application**
|
||||||
|
|
||||||
Select **Azure Active Directory → App Registrations → New Registration**
|
Select **Azure Active Directory → App Registrations → New Registration**
|
||||||
<img src="/img/m365app_create_new.png" className="guideImages"/>
|
<img src="/img/m365app_create_new.png" className="guideImages"/>
|
||||||
|
|
||||||
2. **Configure basic settings**
|
1. **Configure basic settings**
|
||||||
|
|
||||||
* Give the application a name
|
* Give the application a name
|
||||||
* Select **Accounts in this organizational directory only**
|
* Select **Accounts in this organizational directory only**
|
||||||
@ -27,7 +27,7 @@ The following steps outline a simplified procedure for creating an Azure Ad appl
|
|||||||
|
|
||||||
<br/><img src="/img/m365app_configure.png" className="guideImages"/>
|
<br/><img src="/img/m365app_configure.png" className="guideImages"/>
|
||||||
|
|
||||||
3. **Configure required permissions**
|
1. **Configure required permissions**
|
||||||
|
|
||||||
Select **App Permission** from the app management panel.
|
Select **App Permission** from the app management panel.
|
||||||
|
|
||||||
@ -35,14 +35,16 @@ The following steps outline a simplified procedure for creating an Azure Ad appl
|
|||||||
|
|
||||||
The required permissions are as follows:
|
The required permissions are as follows:
|
||||||
|
|
||||||
**TODO: Complete list of permissions**
|
<!-- vale proselint.Annotations = NO -->
|
||||||
|
TODO: Complete list of permissions
|
||||||
|
<!-- vale proselint.Annotations = YES -->
|
||||||
|
|
||||||
| API / Permissions Name | Type |
|
| API / Permissions Name | Type |
|
||||||
|--|--|
|
|:--|:--|
|
||||||
| Permission 1 | Application |
|
| Permission 1 | Application |
|
||||||
| Permission 2 | Delegated |
|
| Permission 2 | Delegated |
|
||||||
|
|
||||||
4. **Grant admin consent**
|
1. **Grant admin consent**
|
||||||
|
|
||||||
<img src="/img/m365app_consent.png" className="guideImages"/>
|
<img src="/img/m365app_consent.png" className="guideImages"/>
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,9 @@ Before setting you your Corso S3 repository, the following prerequisites must be
|
|||||||
* S3 bucket for the repository already exists. Corso won't create it for you.
|
* S3 bucket for the repository already exists. Corso won't create it for you.
|
||||||
* You have access to credentials for a user or an IAM role that represent the following permissions
|
* You have access to credentials for a user or an IAM role that represent the following permissions
|
||||||
|
|
||||||
|
<!-- vale proselint.Annotations = NO -->
|
||||||
**TODO: Verify if these permissions are correct? What about multi-part upload permissions?**
|
**TODO: Verify if these permissions are correct? What about multi-part upload permissions?**
|
||||||
|
<!-- vale proselint.Annotations = YES -->
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
# Architecture
|
# Architecture
|
||||||
|
|
||||||
|
<!-- vale proselint.Annotations = NO -->
|
||||||
TODO
|
TODO
|
||||||
|
<!-- vale proselint.Annotations = YES -->
|
||||||
@ -1,3 +1,5 @@
|
|||||||
# Build from source
|
# Build from source
|
||||||
|
|
||||||
|
<!-- vale proselint.Annotations = NO -->
|
||||||
TODO
|
TODO
|
||||||
|
<!-- vale proselint.Annotations = YES -->
|
||||||
|
|||||||
@ -26,7 +26,7 @@ installed.
|
|||||||
There’s a `Makefile` in the corso/src that will automatically check if the proper
|
There’s a `Makefile` in the corso/src that will automatically check if the proper
|
||||||
golangci-lint version is installed and run it. This make rule can be run
|
golangci-lint version is installed and run it. This make rule can be run
|
||||||
with `make lint`. If golangci-lint isn't installed locally or the wrong version
|
with `make lint`. If golangci-lint isn't installed locally or the wrong version
|
||||||
is present it will tell you what version it expects and provide a link to the
|
is present it will tell you what version it expects along with a link to the
|
||||||
installation page.
|
installation page.
|
||||||
|
|
||||||
### Running manually
|
### Running manually
|
||||||
@ -36,8 +36,8 @@ directory. This will automatically use corso's `.golangci.yml` configuration.
|
|||||||
|
|
||||||
## Adding exceptions for lint errors
|
## Adding exceptions for lint errors
|
||||||
|
|
||||||
Sometimes the linter will report an issue but it's not something that can or
|
Sometimes the linter will report an issue but it's not something that you can or
|
||||||
should be fixed. In those cases there are two ways to add a linter exception:
|
should fix. In those cases there are two ways to add a linter exception:
|
||||||
|
|
||||||
### Single exception via comment
|
### Single exception via comment
|
||||||
|
|
||||||
@ -68,10 +68,12 @@ Some of the enabled linters, like `wsl`, are picky about how code is arranged.
|
|||||||
This section provides some tips on how to organize code to reduce lint errors.
|
This section provides some tips on how to organize code to reduce lint errors.
|
||||||
|
|
||||||
### `wsl`
|
### `wsl`
|
||||||
|
|
||||||
`wsl` is a linter that requires blank lines in parts of the code. It helps make
|
`wsl` is a linter that requires blank lines in parts of the code. It helps make
|
||||||
the codebase more uniform and ensures the code doesn't feel too compact.
|
the codebase uniform and ensures the code doesn't feel too compact.
|
||||||
|
|
||||||
#### Short-assignments versus var declarations
|
#### Short-assignments versus var declarations
|
||||||
|
|
||||||
Go allows declaring and assigning to a variable with either short-assignments
|
Go allows declaring and assigning to a variable with either short-assignments
|
||||||
(`x := 42`) or var assignments (`var x = 42`). `wsl` doesn't allow
|
(`x := 42`) or var assignments (`var x = 42`). `wsl` doesn't allow
|
||||||
grouping these two types of variable declarations together. To work around this,
|
grouping these two types of variable declarations together. To work around this,
|
||||||
@ -97,6 +99,7 @@ var (
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Post-increment and assignments
|
#### Post-increment and assignments
|
||||||
|
|
||||||
`wsl` doesn't allow statements before an assignment without a blank line
|
`wsl` doesn't allow statements before an assignment without a blank line
|
||||||
separating the two. Post-increment operators (e.x. `x++`) count as statements
|
separating the two. Post-increment operators (e.x. `x++`) count as statements
|
||||||
instead of assignments and may cause `wsl` to report an error. You can avoid
|
instead of assignments and may cause `wsl` to report an error. You can avoid
|
||||||
@ -118,6 +121,7 @@ x++
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Functions using recently assigned values
|
#### Functions using recently assigned values
|
||||||
|
|
||||||
`wsl` allows functions immediately after assignments, but only if the function
|
`wsl` allows functions immediately after assignments, but only if the function
|
||||||
uses the assigned value. This requires an ordering for assignments and
|
uses the assigned value. This requires an ordering for assignments and
|
||||||
function calls.
|
function calls.
|
||||||
@ -150,6 +154,7 @@ foo(a, b)
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Function calls and checking returned error values
|
#### Function calls and checking returned error values
|
||||||
|
|
||||||
One of the other linters expects error checks to follow assignments to the error
|
One of the other linters expects error checks to follow assignments to the error
|
||||||
variable without blank lines separating the two. One the other hand, `wsl` has
|
variable without blank lines separating the two. One the other hand, `wsl` has
|
||||||
requirements about what statements can be mixed with assignments. To work
|
requirements about what statements can be mixed with assignments. To work
|
||||||
@ -180,8 +185,7 @@ if err != nil {
|
|||||||
## Common problem linters
|
## Common problem linters
|
||||||
|
|
||||||
Some linter messages aren't clear about what the issue is. Here's common
|
Some linter messages aren't clear about what the issue is. Here's common
|
||||||
cryptic messages we've dealt with in the past and how you can fix the problems
|
cryptic messages how you can fix the problems the linters flag.
|
||||||
the linters flag.
|
|
||||||
Each subsection also includes the version of golangci-lint it applies to and the
|
Each subsection also includes the version of golangci-lint it applies to and the
|
||||||
linter in question.
|
linter in question.
|
||||||
|
|
||||||
@ -190,8 +194,8 @@ linter in question.
|
|||||||
This applies to golangci-lint v1.45.2 for the `gci` linter and is due to an import
|
This applies to golangci-lint v1.45.2 for the `gci` linter and is due to an import
|
||||||
ordering issue. It occurs because imports in the file aren't grouped according
|
ordering issue. It occurs because imports in the file aren't grouped according
|
||||||
to the import rules for Corso. Corso code should have three distinct import
|
to the import rules for Corso. Corso code should have three distinct import
|
||||||
groups: system imports, third party imports, and imports of other Corso packaged;
|
groups: system imports, third party imports, and imports of other Corso packaged
|
||||||
see the example below. Typically the cause of a `gci` lint error is a Corso import in the
|
(see the example below). Typically the cause of a `gci` lint error is a Corso import in the
|
||||||
block for third party libraries.
|
block for third party libraries.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|||||||
@ -12,5 +12,5 @@ beyond M365, will expand based on the interest and needs of the community.
|
|||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
Follow the instructions in the [Installation](/install) and [Initial Configuration](/configuration/concepts) sections to setup
|
Follow the instructions in the [Installation](/install) and [Initial Configuration](/configuration/concepts) sections to
|
||||||
Corso and get it ready for first use. You can then go through the [Tutorial](/tutorial) section to see it in action.
|
setup Corso and get it ready for first use. You can then go through the [Tutorial](/tutorial) section to see it in action.
|
||||||
|
|||||||
@ -27,7 +27,9 @@ $ docker run -e CORSO_PASSPHRASE \
|
|||||||
Your first backup may take some time if your mailbox is large.
|
Your first backup may take some time if your mailbox is large.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
<!-- vale proselint.Annotations = NO -->
|
||||||
**TODO:** Update ^^^ after the finalization of Corso output from operations.
|
**TODO:** Update ^^^ after the finalization of Corso output from operations.
|
||||||
|
<!-- vale proselint.Annotations = YES -->
|
||||||
|
|
||||||
## Restore an email
|
## Restore an email
|
||||||
|
|
||||||
@ -42,8 +44,9 @@ $ docker run -e CORSO_PASSPHRASE \
|
|||||||
-v ~/.corso/logs:/app/logs corso/corso:latest \
|
-v ~/.corso/logs:/app/logs corso/corso:latest \
|
||||||
backup list exchange --user <your exchange email address>
|
backup list exchange --user <your exchange email address>
|
||||||
```
|
```
|
||||||
|
<!-- vale proselint.Annotations = NO -->
|
||||||
**TODO:** Update ^^^ after the finalization of Corso output from operations.
|
**TODO:** Update ^^^ after the finalization of Corso output from operations.
|
||||||
|
<!-- vale proselint.Annotations = YES -->
|
||||||
|
|
||||||
Select one of the available backups and search through its contents.
|
Select one of the available backups and search through its contents.
|
||||||
|
|
||||||
@ -58,7 +61,7 @@ $ docker run -e CORSO_PASSPHRASE \
|
|||||||
--email-subject <portion of subject of email you want to recover>
|
--email-subject <portion of subject of email you want to recover>
|
||||||
```
|
```
|
||||||
|
|
||||||
The output from the executed command above should display a list of any matching emails. Note the ID
|
The output from the command above should display a list of any matching emails. Note the ID
|
||||||
of the one to use for testing restore.
|
of the one to use for testing restore.
|
||||||
|
|
||||||
When you are ready to restore, use the following command:
|
When you are ready to restore, use the following command:
|
||||||
|
|||||||
@ -65,3 +65,4 @@ exceptions:
|
|||||||
- XSS
|
- XSS
|
||||||
- YAML
|
- YAML
|
||||||
- ZIP
|
- ZIP
|
||||||
|
- HOME
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
Corso
|
[Cc]orso
|
||||||
Docusaurus
|
Docusaurus
|
||||||
config
|
[Cc]onfig
|
||||||
Config
|
Config
|
||||||
|
datetime
|
||||||
|
(?i)OneDrive
|
||||||
|
[Rr]epo
|
||||||
|
env
|
||||||
@ -149,7 +149,7 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
fs.StringVar(
|
fs.StringVar(
|
||||||
&eventRecurs,
|
&eventRecurs,
|
||||||
"event-recurs", "",
|
"event-recurs", "",
|
||||||
"Select backup details if the event recurs. Use --event-recurs false to select where the event does not recur.")
|
"Select backup details if the event recurs. Use `--event-recurs` false to select non-recurring events")
|
||||||
fs.StringVar(
|
fs.StringVar(
|
||||||
&eventStartsAfter,
|
&eventStartsAfter,
|
||||||
"event-starts-after", "",
|
"event-starts-after", "",
|
||||||
|
|||||||
@ -108,7 +108,7 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
fs.StringVar(
|
fs.StringVar(
|
||||||
&eventRecurs,
|
&eventRecurs,
|
||||||
"event-recurs", "",
|
"event-recurs", "",
|
||||||
"Restore events if the event recurs. Use --event-recurs false to select where the event does not recur.")
|
"Restore events if the event recurs. Use `--event-recurs false` to select non-recurring events")
|
||||||
fs.StringVar(
|
fs.StringVar(
|
||||||
&eventStartsAfter,
|
&eventStartsAfter,
|
||||||
"event-starts-after", "",
|
"event-starts-after", "",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user