Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Markdown scans and PR template #40

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/markdown-link-check.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ignorePatterns": [
{
"pattern": "^https://opensource.org"
}
],
"httpHeaders": [
{
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
}
18 changes: 18 additions & 0 deletions .github/markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "markdownlint",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+)(:(\\d+))? (MD\\d+\\/[^ ]+) (.*)$",
"file": 1,
"line": 2,
"column": 4,
"code": 5,
"message": 6
}
]
}
]
}
10 changes: 10 additions & 0 deletions .github/markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"default": true,
"MD013": {
"line_length": 120
},
"MD029": false,
"MD025": false,
"MD034": false,
"MD041": false
}
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Fixes
<!-- List the issue(s) this PR resolves -->
-

## Changes
<!-- List the changes this PR introduces -->
-

## Checklist
<!-- Put an `x` in the boxes. All tasks must be completed and boxes checked before merging. -->
- [ ] 🤖 This change is covered by unit tests (if applicable).
- [ ] 🤹 Manual testing has been performed (if necessary).
- [ ] 🛡️ Security impacts have been considered (if relevant).
- [ ] 📖 Documentation updates are complete (if required).
- [ ] 🧠 Third-party dependencies and TPIP updated (if required).
58 changes: 58 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: markdown
on:
pull_request:
paths:
- '.github/workflows/markdown.yml'
- '.github/markdownlint.json'
- '.github/markdownlint.jsonc'
- '**/*.md'

# Declare default permissions as read only.
permissions: read-all

jobs:
lint:
name: Lint markdown files
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Register markdownlint warning matcher
run: |
echo "::add-matcher::.github/markdownlint.json"

- name: Lint markdown files
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb # v1.5.0
with:
args: '**/*.md'
config: '.github/markdownlint.jsonc'
ignore: 'third_party_licenses.md CHANGELOG.md'

- name: Remove markdownlint warning matcher
if: always()
run: |
echo "::remove-matcher owner=markdownlint::"

check-links:
name: Check markdown links
runs-on: ubuntu-latest
steps:
- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Check links
uses: gaurav-nelson/github-action-markdown-link-check@1b916f2cf6c36510a6059943104e3c42ce6c16bc # master
# Checks all Markdown files, including those in subfolders,
# as the PR may involve removing referenced Markdown files.
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
base-branch: ${{ github.base_ref }}
config-file: '.github/markdown-link-check.jsonc'

14 changes: 11 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Contributing to vidx2pidx

We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
Expand All @@ -7,10 +8,13 @@ We want to make contributing to this project as easy and transparent as possible
- Proposing new features

## We develop with Github

We use Github to host code, track issues and feature requests, as well as accept pull requests.

## We use [Github flow](https://guides.github.com/introduction/flow/index.html), so all code changes happen through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
## We use [Github flow](https://guides.github.com/introduction/flow/index.html),so all changes go through Pull Requests

Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)).
We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add [tests](https://golang.org/pkg/testing/).
Expand All @@ -20,9 +24,11 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu
6. Open a [pull request](https://github.com/Open-CMSIS-Pack/vidx2pidx/pulls)!

## Report bugs using Github's [issues](https://github.com/Open-CMSIS-Pack/vidx2pidx/issues)

We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/Open-CMSIS-Pack/vidx2pidx/issues/new).

## Write bug reports with detail, background, and sample code

**Great Bug Reports** tend to have:

- A quick summary and/or background
Expand All @@ -34,4 +40,6 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

## Any contributions you make will be under the Apache 2.0 Software License
In short, when you submit code changes, your submissions are understood to be under the same [Apache 2.0 License](https://choosealicense.com/licenses/apache-2.0/) that covers the project. Feel free to contact the maintainers if that's a concern.

In short, when you submit code changes, your submissions are understood to be under the same [Apache 2.0 License](https://choosealicense.com/licenses/apache-2.0/)
that covers the project. Feel free to contact the maintainers if that's a concern.
68 changes: 46 additions & 22 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,56 @@
# Developing vidx2pidx
# Developing `vidx2pidx`

Follow steps below to start developing for `vidx2pidx`:
1. Requirements:
- [Install Make](https://www.gnu.org/software/make/)
- [Install Golang](https://golang.org/doc/install)
- [Install GolangCI-Lint](https://golangci-lint.run/usage/install/#local-installation)
Follow these steps to set up and start developing for `vidx2pidx`:

2. Clone the repo:
`$ git clone https://github.com/open-cmsis-pack/vidx2pidx.git`
## Prerequisites

3. Enter the checked source
`cd vidx2pidx`
Ensure you have the following installed:

4. Configure your local environment
`make config`
- [GNU Make](https://www.gnu.org/software/make/)
- [Golang](https://golang.org/doc/install)
- [GolangCI-Lint](https://golangci-lint.run/usage/install/#local-installation)

5. Make sure all tests are passing
`make test-all`
## Setup

6. Make sure it builds
`make build/vidx2pidx`
1. Clone the repository:

7. Done! You can now start changing the source code, please refer to [contributing guide](CONTRIBUTING.md) to start contributing to the project
```sh
git clone https://github.com/open-cmsis-pack/vidx2pidx.git
```

# Releasing
2. Navigate into the project directory:

If you have rights to push to the `main` branch of this repo, you might be entitled to
make releases. Do that by running:
`make release`
```sh
cd vidx2pidx
```

*NOTE*: We use [Semantic Versioning](https://semver.org/) for versioning vidx2pidx.
3. Configure your local environment:

```sh
make config
```

4. Run tests to verify everything is working:

```sh
make test-all
```

5. Build the project:

```sh
make build/vidx2pidx
```

6. You're all set! 🎉 Start modifying the source code and refer to the [Contributing Guide](CONTRIBUTING.md)
for guidelines on contributing.

## Releasing

If you have push access to the `main` branch, you can create a new release by running:

```sh
make release
```

📌 **Note:** We follow [Semantic Versioning](https://semver.org/) for versioning `vidx2pidx`.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ and generate a `pidx`-formatted output listing packages.

Just head to the release page and download the binary for your system.


## Usage

- update your `vendor.pidx` file as [documented](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/packIndexFile.html#pidxFile)
```

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<vendor>MyVendor</vendor>
Expand All @@ -32,8 +33,10 @@ Just head to the release page and download the binary for your system.
</pindex>
</index>
```
- create a vendor index file as [documented]( )
```

- create a vendor index file as documented

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<index schemaVersion="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PackIndex.xsd">
<vendor>MyVendor</vendor>
Expand All @@ -45,7 +48,9 @@ Just head to the release page and download the binary for your system.
</vindex>
</index>
```
- invoke `vidx2pidx vendor.vidx`

- invoke `vidx2pidx vendor.vidx`

```bash
$ vidx2pidx <index>.vidx

Expand All @@ -60,6 +65,7 @@ Just head to the release page and download the binary for your system.
```

Now the generated `index.pidx` can be used with cpackget to validate that all listed packs can be installed:
- invoke `cpackget init ./index.pidx -R ./pack_root_test` to use the generated index.pidx in pack_root_test/.Web/index.pidx
- invoke `cpackget --public -R /pack_root_test` to list all latest public pack versions

- invoke `cpackget init ./index.pidx -R ./pack_root_test` to use the generated index.pidx in
pack_root_test/.Web/index.pidx
- invoke `cpackget --public -R /pack_root_test` to list all latest public pack versions