Skip to content

Commit

Permalink
Merge remote branch 'upstreamrepo/main'
Browse files Browse the repository at this point in the history
Change-Id: Ic504807ad6bf6a0c689e6a4e6fb0e8c9b0d6039b
  • Loading branch information
Corallo committed May 13, 2024
2 parents a9e1b11 + 1367487 commit be6b154
Show file tree
Hide file tree
Showing 74 changed files with 880 additions and 529 deletions.
8 changes: 8 additions & 0 deletions .github/super-linter.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VALIDATE_ALL_CODEBASE=true
IGNORE_GITIGNORED_FILES=true
LINTER_RULES_PATH=/
FILTER_REGEX_EXCLUDE=docs/develop/manifest-schemas/schema-field-descriptions-v\d+(\.\d){1,2}(-[a-z0-9]*)*.md|docs/api/src/.*|3\.[45]/.*|docs/acap-sdk-version-3/api/src/.*
MARKDOWN_CONFIG_FILE=.markdownlint.yml
NATURAL_LANGUAGE_CONFIG_FILE=.textlintrc
VALIDATE_MARKDOWN=true
VALIDATE_NATURAL_LANGUAGE=true
12 changes: 5 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
run-linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check that no private Docker Hub URLs are used
Expand All @@ -27,12 +28,9 @@ jobs:
ret=1
}
exit $ret
- uses: github/super-linter/slim@v5
- run: cat .github/super-linter.env >> "$GITHUB_ENV"
- name: Lint Code Base
uses: super-linter/super-linter/slim@v5
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: /
FILTER_REGEX_EXCLUDE: docs/develop/manifest-schemas/schema-field-descriptions-v\d+(\.\d){1,2}(-[a-z0-9]*)*.md
VALIDATE_MARKDOWN: true
MARKDOWN_CONFIG_FILE: .markdownlint.yml
VALIDATE_NATURAL_LANGUAGE: true
15 changes: 15 additions & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"filters": {
"comments": true
},
"rules": {
"terminology": {
"defaultTerms": true,
"exclude": ["bug[- ]fix(es)?", "bugfix$1"],
"terms": [
["bug[-]fix(es)?", "bug fix$1"],
["bugfix(es)?", "bug fix$1"]
],
},
}
}
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ threatening, offensive, or harmful.

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
representing a project or community include using an official project email
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at oss-conduct@axis.com. All
reported by contacting the project team at <oss-conduct@axis.com>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
39 changes: 31 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,27 @@ In order to fasten up development, it's possible to run linters as part of your

#### Run super-linter locally

Since super-linter is using a Docker image in GitHub Actions, users of other editors may run it locally to lint the codebase. For complete instructions and guidance, see super-linter page for [running locally](https://github.com/github/super-linter/blob/main/docs/run-linter-locally.md).
Since super-linter is using a Docker image in GitHub Actions, users of other editors may run it locally to lint the codebase. For complete instructions and guidance, see super-linter page for [running locally](https://github.com/super-linter/super-linter/blob/main/docs/run-linter-locally.md).

To run a number of linters on the codebase from command-line:
To run all linters on the codebase from command-line, the same that would run
when a Pull Request is opened, use command:

```sh
docker run --rm \
-v $PWD:/tmp/lint \
-e RUN_LOCAL=true \
--env-file ".github/super-linter.env" \
ghcr.io/super-linter/super-linter:slim-v5
```

For more details which linters that run and the settings, see the file
`.github/super-linter.env`.

To only test one specific linter, e.g. lint Markdown, see the variable name in
`.github/super-linter.env` that in this case is `VALIDATE_MARKDOWN=true`. Note
that you also need to specify the linter configuration file if there is one.
In this case `MARKDOWN_CONFIG_FILE=.markdownlint` together with the location
via `LINTER_RULES_PATH=/`. Then run the single linter with this command:

```sh
docker run --rm \
Expand All @@ -92,27 +110,30 @@ docker run --rm \
-e FILTER_REGEX_EXCLUDE='docs/develop/manifest-schemas/schema-field-descriptions-v*' \
-e VALIDATE_MARKDOWN=true \
-e MARKDOWN_CONFIG_FILE=.markdownlint.yml \
-e VALIDATE_NATURAL_LANGUAGE=true \
github/super-linter:slim-v4
ghcr.io/super-linter/super-linter:slim-v5
```

##### Run super-linter interactively

It might be more convenient to run super-linter interactively. Run container and enter command-line:
It might be more convenient to run super-linter interactively. Run the container
with your user to not change ownership of files.

```sh
docker run --rm \
-u $(id -u):$(id -g) \
-e USER \
-v $PWD:/tmp/lint \
-w /tmp/lint \
--entrypoint /bin/bash \
-it github/super-linter:slim-v4
-it ghcr.io/super-linter/super-linter:slim-v5
```

Then from the container terminal, the following commands can lint the codebase for different file types:
Then from the container terminal, the following commands can lint the codebase
for different file types:

```sh
# Lint Markdown files
markdownlint -i docs/develop/schema-field-descriptions-v\* .
markdownlint -i docs/release-notes/\* .
```

## Open a pull request
Expand Down Expand Up @@ -261,12 +282,14 @@ language in [pygments.org](https://pygments.org/docs/lexers/) and use the
**Some common languages short names:**

<!-- textlint-disable -->

- bash, sh
- make
- dockerfile
- json
- c
- html

<!-- textlint-enable -->

### Change of layout
Expand Down
Loading

0 comments on commit be6b154

Please sign in to comment.