Skip to content

Commit b3b403b

Browse files
authored
Add markdownlint and fix issues (#355)
1 parent e8f03c8 commit b3b403b

13 files changed

+324
-175
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ A clear and concise description of what the bug is.
1111

1212
Provide the following files as part of the bug report
1313

14-
* NGINX Plus configuration. Run `sudo nginx -T` to gather the full configuration
15-
* nginx-asg-sync configuration from `/etc/nginx/config.yaml`
14+
- NGINX Plus configuration. Run `sudo nginx -T` to gather the full configuration
15+
- nginx-asg-sync configuration from `/etc/nginx/config.yaml`
1616

1717
Steps to reproduce the behavior, such as:
18+
1819
1. Scale from 2 to 5 EC2 instances
1920
2. New instances not added to nginx.conf
2021
3. See error in `/var/log/nginx-asg-sync/nginx-asg-sync.log`
@@ -23,9 +24,10 @@ Steps to reproduce the behavior, such as:
2324
A clear and concise description of what you expected to happen.
2425

2526
**Your environment**
26-
* Version of nginx-asg-sync
27-
* Version of NGINX Plus
28-
* Version of the OS
27+
28+
- Version of nginx-asg-sync
29+
- Version of NGINX Plus
30+
- Version of the OS
2931

3032
**Additional context**
3133
Add any other context about the problem here. Any log files you want to share.

.github/PULL_REQUEST_TEMPLATE.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
### Proposed changes
2-
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue here in this description (not in the title of the PR).
2+
3+
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to
4+
that issue here in this description (not in the title of the PR).
35

46
### Checklist
7+
58
Before creating a PR, run through this checklist and mark each as complete.
69

710
- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/nginx-asg-sync/blob/main/CONTRIBUTING.md) doc

.markdownlint-cli2.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Rule configuration.
2+
# For rule descriptions and how to fix: https://github.com/DavidAnson/markdownlint/tree/main#rules--aliases
3+
config:
4+
ul-style:
5+
style: dash
6+
no-duplicate-heading:
7+
siblings_only: true
8+
line-length:
9+
line_length: 120
10+
code_blocks: false
11+
tables: false
12+
13+
# Define glob expressions to ignore
14+
ignores:
15+
- ".github/"
16+
17+
# Fix any fixable errors
18+
fix: true

.pre-commit-config.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ repos:
2525
- id: requirements-txt-fixer
2626
- id: fix-byte-order-marker
2727
- id: detect-private-key
28+
2829
- repo: local
2930
hooks:
3031
- id: golang-diff
@@ -33,23 +34,32 @@ repos:
3334
language: system
3435
types: [go]
3536
pass_filenames: false
37+
3638
- repo: https://github.com/golangci/golangci-lint
3739
rev: v1.53.3
3840
hooks:
3941
- id: golangci-lint
4042
args: [--new-from-patch=/tmp/diff.patch]
43+
4144
- repo: https://github.com/asottile/pyupgrade
4245
rev: v3.10.1
4346
hooks:
4447
- id: pyupgrade
48+
4549
- repo: https://github.com/PyCQA/isort
4650
rev: 5.12.0
4751
hooks:
4852
- id: isort
53+
4954
- repo: https://github.com/psf/black
5055
rev: 23.7.0
5156
hooks:
5257
- id: black
5358

59+
- repo: https://github.com/DavidAnson/markdownlint-cli2
60+
rev: v0.8.1
61+
hooks:
62+
- id: markdownlint-cli2
63+
5464
ci:
5565
skip: [golang-diff, golangci-lint]

CHANGELOG.md

+25-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1+
# Changelog
2+
13
## 0.5.0 (February 24, 2021)
24

35
IMPROVEMENTS:
46

5-
* Add InService option for AWS [#39](https://github.com/nginxinc/nginx-asg-sync/pull/39)
6-
* Update log format [#42](https://github.com/nginxinc/nginx-asg-sync/pull/42)
7+
- Add InService option for AWS [#39](https://github.com/nginxinc/nginx-asg-sync/pull/39)
8+
- Update log format [#42](https://github.com/nginxinc/nginx-asg-sync/pull/42)
79

810
## 0.4-1 (November 22, 2019)
911

1012
IMPROVEMENTS:
1113

12-
* Add support to set upstream server parameters: `max_conns`, `max_fails`, `fail_timeout` and `slow_start` in the configuration file. https://github.com/nginxinc/nginx-asg-sync/pull/33
13-
* Add support to use wildcards in the names of AWS Auto Scaling groups. https://github.com/nginxinc/nginx-asg-sync/pull/29/
14-
* Allow nginx-asg-sync to detect the region where it is running (use `region: self` in the configuration file). https://github.com/nginxinc/nginx-asg-sync/pull/27
14+
- Add support to set upstream server parameters: `max_conns`, `max_fails`, `fail_timeout` and `slow_start` in the
15+
configuration file. <https://github.com/nginxinc/nginx-asg-sync/pull/33>
16+
- Add support to use wildcards in the names of AWS Auto Scaling groups.
17+
<https://github.com/nginxinc/nginx-asg-sync/pull/29/>
18+
- Allow nginx-asg-sync to detect the region where it is running (use `region: self` in the configuration file).
19+
<https://github.com/nginxinc/nginx-asg-sync/pull/27>
1520

1621
## 0.3-1 (September 4, 2019)
1722

1823
IMPROVEMENTS:
1924

20-
* Add support for Azure Virtual Machine Scale Sets https://github.com/nginxinc/nginx-asg-sync/pull/24
21-
* Create separate documentation for the configuration for different cloud providers: [aws](examples/aws.md) and [azure](examples/azure.md).
22-
* Ubuntu 14.04 (Trusty) is no longer supported.
25+
- Add support for Azure Virtual Machine Scale Sets <https://github.com/nginxinc/nginx-asg-sync/pull/24>
26+
- Create separate documentation for the configuration for different cloud providers: [aws](examples/aws.md) and
27+
[azure](examples/azure.md).
28+
- Ubuntu 14.04 (Trusty) is no longer supported.
2329

2430
UPGRADE:
2531

@@ -35,20 +41,23 @@ Note: the supported versions of NGINX Plus are R18 and higher.
3541

3642
IMPROVEMENTS:
3743

38-
* Add supporting documentation for the project https://github.com/nginxinc/nginx-asg-sync/pull/10
39-
* Update package layout https://github.com/nginxinc/nginx-asg-sync/pull/9
40-
* Use new NGINX Plus API https://github.com/nginxinc/nginx-asg-sync/pull/7
44+
- Add supporting documentation for the project <https://github.com/nginxinc/nginx-asg-sync/pull/10>
45+
- Update package layout <https://github.com/nginxinc/nginx-asg-sync/pull/9>
46+
- Use new NGINX Plus API <https://github.com/nginxinc/nginx-asg-sync/pull/7>
4147

4248
UPGRADE:
4349

44-
The upgrade process requires changing both NGINX Plus configuration and nginx-asg-sync configuration. Below are the recommended steps to follow:
50+
The upgrade process requires changing both NGINX Plus configuration and nginx-asg-sync configuration. Below are the
51+
recommended steps to follow:
4552

4653
1. Upgrade NGINX Plus to R14 or R15
47-
2. Enable the new API in the NGINX Plus configuration while keeping the upstream_conf and the status API enabled. See an example of configuring the new API in the configuration section, but make sure to keep the upstream_conf and the status API.
54+
2. Enable the new API in the NGINX Plus configuration while keeping the upstream_conf and the status API enabled. See an
55+
example of configuring the new API in the configuration section, but make sure to keep the upstream_conf and the
56+
status API.
4857
3. Reload NGINX Plus to apply the updated configuration
4958
4. Modify the /etc/nginx/aws.yaml file:
50-
* Remove the `upstream_conf_endpoint` and `status_endpoint` fields.
51-
* Add the `api_endpoint` field. See an example in the configuration section of the README.md
59+
- Remove the `upstream_conf_endpoint` and `status_endpoint` fields.
60+
- Add the `api_endpoint` field. See an example in the configuration section of the README.md
5261
5. Download the Release 0.2 nginx-asg-sync package for your OS and upgrade the package using the OS tools (dpkg or rpm).
5362
6. Check the logs of nginx-asg-sync to make sure that it is working properly after the upgrade.
5463
7. Finally remove the upstream_conf and the status API from NGINX Plus configuration.
@@ -60,8 +69,7 @@ Note: the supported versions of NGINX Plus are R14 and higher.
6069

6170
IMPROVEMENTS:
6271

63-
* Make sure nginx-asg-sync works with NGINX Plus R13
64-
72+
- Make sure nginx-asg-sync works with NGINX Plus R13
6573

6674
## 0.1-1 (March 6, 2017)
6775

CODE_OF_CONDUCT.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ appearance, race, religion, or sexual identity and orientation.
1616
Examples of behavior that contributes to creating a positive environment
1717
include:
1818

19-
* Using welcoming and inclusive language
20-
* Being respectful of differing viewpoints and experiences
21-
* Gracefully accepting constructive criticism
22-
* Focusing on what is best for the community
23-
* Showing empathy towards other community members
19+
- Using welcoming and inclusive language
20+
- Being respectful of differing viewpoints and experiences
21+
- Gracefully accepting constructive criticism
22+
- Focusing on what is best for the community
23+
- Showing empathy towards other community members
2424

2525
Examples of unacceptable behavior by participants include:
2626

27-
* The use of sexualized language or imagery and unwelcome sexual attention or
27+
- The use of sexualized language or imagery and unwelcome sexual attention or
2828
advances
29-
* Trolling, insulting/derogatory comments, and personal or political attacks
30-
* Public or private harassment
31-
* Publishing others' private information, such as a physical or electronic
29+
- Trolling, insulting/derogatory comments, and personal or political attacks
30+
- Public or private harassment
31+
- Publishing others' private information, such as a physical or electronic
3232
address, without explicit permission
33-
* Other conduct which could reasonably be considered inappropriate in a
33+
- Other conduct which could reasonably be considered inappropriate in a
3434
professional setting
3535

3636
## Our Responsibilities
@@ -57,7 +57,7 @@ further defined and clarified by project maintainers.
5757
## Enforcement
5858

5959
Instances of abusive, harassing, or otherwise unacceptable behavior may be
60-
reported by contacting the project team at [email protected]. All
60+
reported by contacting the project team at <[email protected]>. All
6161
complaints will be reviewed and investigated and will result in a response that
6262
is deemed necessary and appropriate to the circumstances. The project team is
6363
obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -70,6 +70,6 @@ members of the project's leadership.
7070
## Attribution
7171

7272
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
73-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
73+
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
7474

7575
[homepage]: https://www.contributor-covenant.org

CONTRIBUTING.md

+38-27
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Contributing Guidelines
22

3-
The following is a set of guidelines for contributing to the NGINX AWS Auto-Scale Group Sync tool. We really appreciate that you are considering contributing!
3+
The following is a set of guidelines for contributing to the NGINX AWS Auto-Scale Group Sync tool. We really appreciate
4+
that you are considering contributing!
45

5-
#### Table Of Contents
6+
## Table Of Contents
67

78
[Ask a Question](#ask-a-question)
89

@@ -11,8 +12,9 @@ The following is a set of guidelines for contributing to the NGINX AWS Auto-Scal
1112
[Contributing](#contributing)
1213

1314
[Style Guides](#style-guides)
14-
* [Git Style Guide](#git-style-guide)
15-
* [Go Style Guide](#go-style-guide)
15+
16+
- [Git Style Guide](#git-style-guide)
17+
- [Go Style Guide](#go-style-guide)
1618

1719
[Code of Conduct](CODE_OF_CONDUCT.md)
1820

@@ -24,57 +26,66 @@ You can also join our [Community Slack](https://community.nginx.org/joinslack) w
2426

2527
Please reserve GitHub issues for feature requests and bugs rather than general questions.
2628

27-
2829
## Getting Started
2930

3031
Read the installation, configuration and building steps in the [README](README.md).
3132

3233
### Project Structure
3334

34-
* nginx-asg-sync is a service written in Go that works with NGINX Plus.
35-
* The main code is found under `/cmd/sync/`
36-
* Tools for building the service for supported Operating Systems are found under `/build/package`
37-
* We use [Go modules](https://github.com/golang/go/wiki/Modules) for managing dependencies.
38-
* There is a Makefile at the project root used in the build steps.
35+
- nginx-asg-sync is a service written in Go that works with NGINX Plus.
36+
- The main code is found under `/cmd/sync/`
37+
- Tools for building the service for supported Operating Systems are found under `/build/package`
38+
- We use [Go modules](https://github.com/golang/go/wiki/Modules) for managing dependencies.
39+
- There is a Makefile at the project root used in the build steps.
3940

4041
## Contributing
4142

4243
### Report a Bug
4344

44-
To report a bug, open an issue on GitHub with the label `bug` using the available bug report issue template. Please ensure the issue has not already been reported.
45+
To report a bug, open an issue on GitHub with the label `bug` using the available bug report issue template. Please
46+
ensure the issue has not already been reported.
4547

4648
### Suggest an Enhancement
4749

48-
To suggest an enhancement, please create an issue on GitHub with the label `enhancement` using the available feature issue template.
50+
To suggest an enhancement, please create an issue on GitHub with the label `enhancement` using the available feature
51+
issue template.
4952

5053
### Open a Pull Request
5154

52-
* Fork the repo, create a branch, submit a PR when your changes are tested and ready for review
53-
* Fill in [our pull request template](.github/PULL_REQUEST_TEMPLATE.md)
55+
- Fork the repo, create a branch, submit a PR when your changes are tested and ready for review
56+
- Fill in [our pull request template](.github/PULL_REQUEST_TEMPLATE.md)
5457

5558
> **Note**
5659
>
57-
> If you’d like to implement a new feature, please consider creating a feature request issue first to start a discussion about the feature.
60+
> If you’d like to implement a new feature, please consider creating a feature request issue first to start a discussion
61+
> about the feature.
5862
5963
### Issue lifecycle
6064

61-
* When an issue or PR is created, it will be triaged by the core development team and assigned a label to indicate the type of issue it is (bug, feature request, etc) and to determine the milestone. Please see the [Issue Lifecycle](ISSUE_LIFECYCLE.md) document for more information.
65+
- When an issue or PR is created, it will be triaged by the core development team and assigned a label to indicate the
66+
type of issue it is (bug, feature request, etc) and to determine the milestone. Please see the [Issue
67+
Lifecycle](ISSUE_LIFECYCLE.md) document for more information.
6268

6369
## Style Guides
6470

6571
### Git Style Guide
6672

67-
* Keep a clean, concise and meaningful git commit history on your branch, rebasing locally and squashing before submitting a PR
68-
* Follow the guidelines of writing a good commit message as described here https://chris.beams.io/posts/git-commit/ and summarized in the next few points
69-
* In the subject line, use the present tense ("Add feature" not "Added feature")
70-
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
71-
* Limit the subject line to 72 characters or less
72-
* Reference issues and pull requests liberally after the subject line
73-
* Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in your text editor to write a good message instead of `git commit -am`)
73+
- Keep a clean, concise and meaningful git commit history on your branch, rebasing locally and squashing before
74+
submitting a PR
75+
- Follow the guidelines of writing a good commit message as described here <https://chris.beams.io/posts/git-commit/>
76+
and summarized in the next few points
77+
- In the subject line, use the present tense ("Add feature" not "Added feature")
78+
- In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
79+
- Limit the subject line to 72 characters or less
80+
- Reference issues and pull requests liberally after the subject line
81+
- Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in
82+
your text editor to write a good message instead of `git commit -am`)
7483

7584
### Go Style Guide
7685

77-
* Run `gofmt` over your code to automatically resolve a lot of style issues. Most editors support this running automatically when saving a code file.
78-
* Run `go lint` and `go vet` on your code too to catch any other issues.
79-
* Follow this guide on some good practice and idioms for Go - https://github.com/golang/go/wiki/CodeReviewComments
80-
* To check for extra issues, install [golangci-lint](https://github.com/golangci/golangci-lint) and run `make lint` or `golangci-lint run`
86+
- Run `gofmt` over your code to automatically resolve a lot of style issues. Most editors support this running
87+
automatically when saving a code file.
88+
- Run `go lint` and `go vet` on your code too to catch any other issues.
89+
- Follow this guide on some good practice and idioms for Go - <https://github.com/golang/go/wiki/CodeReviewComments>
90+
- To check for extra issues, install [golangci-lint](https://github.com/golangci/golangci-lint) and run `make lint` or
91+
`golangci-lint run`

0 commit comments

Comments
 (0)