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]
|
||||
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 = (\{\#.*?\}), \
|
||||
(import.*?from.*?;)
|
||||
(import.*?from.*?;),\
|
||||
(?s) (```bash.*?corso.*?$)
|
||||
|
||||
[*.json]
|
||||
BasedOnStyles = Vale
|
||||
|
||||
@ -30,7 +30,7 @@ This command starts a local development server within the Docker container and w
|
||||
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.
|
||||
|
||||
## 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-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-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-before`|||Select backup details where the event starts before this datetime|
|
||||
|`--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-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-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-before`|||Restore events where the event starts before this datetime|
|
||||
|`--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.
|
||||
|
||||
* **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**
|
||||
|
||||
Select **Azure Active Directory → App Registrations → New Registration**
|
||||
<img src="/img/m365app_create_new.png" className="guideImages"/>
|
||||
Select **Azure Active Directory → App Registrations → New Registration**
|
||||
<img src="/img/m365app_create_new.png" className="guideImages"/>
|
||||
|
||||
2. **Configure basic settings**
|
||||
1. **Configure basic settings**
|
||||
|
||||
* Give the application a name
|
||||
* 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"/>
|
||||
|
||||
3. **Configure required permissions**
|
||||
1. **Configure required permissions**
|
||||
|
||||
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:
|
||||
|
||||
**TODO: Complete list of permissions**
|
||||
<!-- vale proselint.Annotations = NO -->
|
||||
TODO: Complete list of permissions
|
||||
<!-- vale proselint.Annotations = YES -->
|
||||
|
||||
| API / Permissions Name | Type |
|
||||
|--|--|
|
||||
|:--|:--|
|
||||
| Permission 1 | Application |
|
||||
| Permission 2 | Delegated |
|
||||
|
||||
4. **Grant admin consent**
|
||||
1. **Grant admin consent**
|
||||
|
||||
<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.
|
||||
* 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?**
|
||||
<!-- vale proselint.Annotations = YES -->
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
# Architecture
|
||||
|
||||
<!-- vale proselint.Annotations = NO -->
|
||||
TODO
|
||||
<!-- vale proselint.Annotations = YES -->
|
||||
@ -1,3 +1,5 @@
|
||||
# Build from source
|
||||
|
||||
<!-- vale proselint.Annotations = NO -->
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
||||
### Running manually
|
||||
@ -36,8 +36,8 @@ directory. This will automatically use corso's `.golangci.yml` configuration.
|
||||
|
||||
## Adding exceptions for lint errors
|
||||
|
||||
Sometimes the linter will report an issue but it's not something that can or
|
||||
should be fixed. In those cases there are two ways to add a linter exception:
|
||||
Sometimes the linter will report an issue but it's not something that you can or
|
||||
should fix. In those cases there are two ways to add a linter exception:
|
||||
|
||||
### 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.
|
||||
|
||||
### `wsl`
|
||||
|
||||
`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
|
||||
|
||||
Go allows declaring and assigning to a variable with either short-assignments
|
||||
(`x := 42`) or var assignments (`var x = 42`). `wsl` doesn't allow
|
||||
grouping these two types of variable declarations together. To work around this,
|
||||
@ -97,6 +99,7 @@ var (
|
||||
```
|
||||
|
||||
#### Post-increment and assignments
|
||||
|
||||
`wsl` doesn't allow statements before an assignment without a blank line
|
||||
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
|
||||
@ -118,6 +121,7 @@ x++
|
||||
```
|
||||
|
||||
#### Functions using recently assigned values
|
||||
|
||||
`wsl` allows functions immediately after assignments, but only if the function
|
||||
uses the assigned value. This requires an ordering for assignments and
|
||||
function calls.
|
||||
@ -150,6 +154,7 @@ foo(a, b)
|
||||
```
|
||||
|
||||
#### Function calls and checking returned error values
|
||||
|
||||
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
|
||||
requirements about what statements can be mixed with assignments. To work
|
||||
@ -180,8 +185,7 @@ if err != nil {
|
||||
## Common problem linters
|
||||
|
||||
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
|
||||
the linters flag.
|
||||
cryptic messages how you can fix the problems the linters flag.
|
||||
Each subsection also includes the version of golangci-lint it applies to and the
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
block for third party libraries.
|
||||
|
||||
```go
|
||||
|
||||
@ -12,5 +12,5 @@ beyond M365, will expand based on the interest and needs of the community.
|
||||
|
||||
## Getting started
|
||||
|
||||
Follow the instructions in the [Installation](/install) and [Initial Configuration](/configuration/concepts) sections to setup
|
||||
Corso and get it ready for first use. You can then go through the [Tutorial](/tutorial) section to see it in action.
|
||||
Follow the instructions in the [Installation](/install) and [Initial Configuration](/configuration/concepts) sections to
|
||||
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.
|
||||
:::
|
||||
|
||||
<!-- vale proselint.Annotations = NO -->
|
||||
**TODO:** Update ^^^ after the finalization of Corso output from operations.
|
||||
<!-- vale proselint.Annotations = YES -->
|
||||
|
||||
## Restore an email
|
||||
|
||||
@ -42,8 +44,9 @@ $ docker run -e CORSO_PASSPHRASE \
|
||||
-v ~/.corso/logs:/app/logs corso/corso:latest \
|
||||
backup list exchange --user <your exchange email address>
|
||||
```
|
||||
|
||||
<!-- vale proselint.Annotations = NO -->
|
||||
**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.
|
||||
|
||||
@ -58,7 +61,7 @@ $ docker run -e CORSO_PASSPHRASE \
|
||||
--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.
|
||||
|
||||
When you are ready to restore, use the following command:
|
||||
|
||||
@ -65,3 +65,4 @@ exceptions:
|
||||
- XSS
|
||||
- YAML
|
||||
- ZIP
|
||||
- HOME
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
Corso
|
||||
[Cc]orso
|
||||
Docusaurus
|
||||
config
|
||||
[Cc]onfig
|
||||
Config
|
||||
datetime
|
||||
(?i)OneDrive
|
||||
[Rr]epo
|
||||
env
|
||||
@ -149,7 +149,7 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
||||
fs.StringVar(
|
||||
&eventRecurs,
|
||||
"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(
|
||||
&eventStartsAfter,
|
||||
"event-starts-after", "",
|
||||
|
||||
@ -108,7 +108,7 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
||||
fs.StringVar(
|
||||
&eventRecurs,
|
||||
"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(
|
||||
&eventStartsAfter,
|
||||
"event-starts-after", "",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user