Skip to content

Commit

Permalink
Trim trailing whitespace from files; add PR check for trailing spaces
Browse files Browse the repository at this point in the history
Add PR check to block merging changes with trailing whitespace on lines.
Check skips binary files, svg files, and anything within the docs/
directory.
  • Loading branch information
amisevsk committed Mar 5, 2024
1 parent 0a496e8 commit 0413fb0
Show file tree
Hide file tree
Showing 21 changed files with 100 additions and 91 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand All @@ -39,8 +39,8 @@ jobs:
name: 'Nightly Builds Download for KitOps CLI (kit)'
prerelease: true
body: |
Welcome to the cutting edge! Our nightly builds offer the most recent developments
in kit CLI, providing early access to new features, enhancements, and
Welcome to the cutting edge! Our nightly builds offer the most recent developments
in kit CLI, providing early access to new features, enhancements, and
fixes that are on their way to the next stable release'
files: |
./dist/*.txt
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ jobs:
echo "Run docs/src/docs/cli/generate.sh and commit the result"
exit 1
fi
- name: Check for trailing whitespace
run: |
files=$(egrep -lI --exclude '*.svg' --exclude 'docs/*' " +$" $(git ls-files))
if [ ! -z $files ]; then
echo "Trailing whitespace in files:"
echo "$files"
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ builds:
- windows
- darwin
binary: kit
ldflags:

ldflags:
- -s -w -X kitops/pkg/cmd/version.Version={{.Version}} -X kitops/pkg/cmd/version.GitCommit={{.Commit}} -X kitops/pkg/cmd/version.BuildTime={{.Date}}

archives:
Expand Down Expand Up @@ -53,6 +53,6 @@ release:
footer: |
Thanks for supporting Kitops.
name_template: "{{.ProjectName}}-{{.Version}}"
skip_upload: false
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ We welcome many different types of contributions including:
* Communications, social media, blog posts, or other marketing
* Release management

Not everything happens through a GitHub pull request. Please contact us in the [#general channel of our Discord server](https://discord.gg/XzSmtPn3) or during our [office hours meeting](./GOVERNANCE.md#meetings) and let's discuss how we can work together.
Not everything happens through a GitHub pull request. Please contact us in the [#general channel of our Discord server](https://discord.gg/XzSmtPn3) or during our [office hours meeting](./GOVERNANCE.md#meetings) and let's discuss how we can work together.

## Development Environment Setup

Expand Down Expand Up @@ -70,9 +70,9 @@ Git has a `-s` command line option to do this automatically:
git commit -s -m 'This is my commit message'

If you forgot to do this and have not yet pushed your changes to the remote
repository, you can amend your commit with the sign-off by running
repository, you can amend your commit with the sign-off by running

git commit --amend -s
git commit --amend -s

## Pull Request Checklist

Expand Down
2 changes: 1 addition & 1 deletion GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To become a Maintainer you need to demonstrate the following:
* Ability to collaborate with the team
* Understanding of how the team works (policies, processes for testing and code review, etc)
* Understanding of the project's code base and coding and documentation style

A new Maintainer must be proposed by an existing maintainer by sending a message in the #general channel in the [KitOps Discord server](https://discord.gg/XzSmtPn3). A simple majority vote of existing Maintainers approves the application. Maintainers nominations will be evaluated without prejudice to employer or demographics.

Maintainers who are selected will be granted the necessary GitHub rights, and invited to the private Maintainers Discord channel.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Then run the project:
./kit
```

Alternatively
Alternatively

```shell
go run kit
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
var (
shortDesc = `Streamline the lifecycle of AI/ML models`
longDesc = `Kit is a tool for efficient AI/ML model lifecycle management.
Find more information at: http://kitops.ml`
)

Expand Down
4 changes: 2 additions & 2 deletions demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Follow these steps to run the demo scripts successfully:

2. **Navigate to the Demo Directory:** Change your current working directory to the demo's directory by using the `cd` command followed by the path to the directory. For example:

```shell
```shell
cd kitops/demo/
```

Expand All @@ -28,4 +28,4 @@ Make sure that `my-demo.sh` is the correct name of the demo script you intend to
chmod +x my-demo.sh
```

Before running these steps, ensure that you have any dependencies or environmental requirements satisfied which are usually recorded as comments on the `.sh` file.
Before running these steps, ensure that you have any dependencies or environmental requirements satisfied which are usually recorded as comments on the `.sh` file.
4 changes: 2 additions & 2 deletions demos/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fi
clear


pe "./kit version"
pe "./kit version"

# Let's check if there are any model kits locally
pe "./kit list"
Expand All @@ -53,7 +53,7 @@ pe "./kit build ../examples/onnx -t localhost:5050/test-repo:test-tag"
pe "./kit list"

# run a local registry
pe "$DOCKER run --name registry --rm -d -p 5050:5050 -e REGISTRY_HTTP_ADDR=:5050 registry"
pe "$DOCKER run --name registry --rm -d -p 5050:5050 -e REGISTRY_HTTP_ADDR=:5050 registry"

# Let's push the model to the local registry
pe "./kit push localhost:5050/test-repo:test-tag --http"
Expand Down
66 changes: 33 additions & 33 deletions docs/src/docs/cli/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Builds a modelkit

### Synopsis

Build a modelkit from a kitfile using the given context directory.
Build a modelkit from a kitfile using the given context directory.

The build process involves taking the configuration and resources defined in
The build process involves taking the configuration and resources defined in
your kitfile and using them to create a modelkit. This modelkit is then stored
in your local registry, making it readily available for further actions such
in your local registry, making it readily available for further actions such
as pushing to a remote registry for collaboration.

Unless a different location is specified, this command looks for the k itfile
at the root of the provided context directory. Any relative paths defined
Unless a different location is specified, this command looks for the k itfile
at the root of the provided context directory. Any relative paths defined
within the kitfile are interpreted as being relative to this context directory.

```
Expand Down Expand Up @@ -52,12 +52,12 @@ Produce the components from a modelkit on the local filesystem
### Synopsis

Produces all or selected components of a modelkit on the local filesystem.
This command exports a modelkit's components, including models, code, datasets,
and configuration files, to a specified directory on the local filesystem.
By default, it attempts to find the modelkit in local storage; if not found, it
searches the remote registry and retrieves it. This process ensures that the
necessary components are always available for export, optimizing for efficiency

This command exports a modelkit's components, including models, code, datasets,
and configuration files, to a specified directory on the local filesystem.
By default, it attempts to find the modelkit in local storage; if not found, it
searches the remote registry and retrieves it. This process ensures that the
necessary components are always available for export, optimizing for efficiency
by fetching only specified components from the remote registry when necessary

```
Expand Down Expand Up @@ -105,16 +105,16 @@ List modelkits in a repository

Displays a list of modelkits available in a repository.

This command provides an overview of modelkits stored either in the local
repository or a specified remote repository. It displays each modelkit along
with its associated tags and the cumulative size of its contents. Modelkits
This command provides an overview of modelkits stored either in the local
repository or a specified remote repository. It displays each modelkit along
with its associated tags and the cumulative size of its contents. Modelkits
comprise multiple artifacts, including models, datasets, code, and configuration,
designed to enhance reusability and modularity. However, this command focuses on
the aggregate rather than listing individual artifacts.

Each modelkit entry includes its DIGEST, a unique identifier that ensures
distinct versions of a modelkit are easily recognizable, even if they share the
same name or tags. Modelkits with multiple tags or repository names will appear
distinct versions of a modelkit are easily recognizable, even if they share the
same name or tags. Modelkits with multiple tags or repository names will appear
multiple times in the list, distinguished by their DIGEST.

The SIZE displayed for each modelkit represents the total storage space occupied
Expand Down Expand Up @@ -224,7 +224,7 @@ Retrieve modelkits from a remote registry to your local environment.

### Synopsis

Downloads modelkits from a specified registry. The downloaded
Downloads modelkits from a specified registry. The downloaded
modelkits are stored in the local registry.

```
Expand Down Expand Up @@ -261,7 +261,7 @@ Uploads modelkits to a specified registry

This command pushes modelkits to a remote registry.

The modelkits should be tagged with the target registry and repository before
The modelkits should be tagged with the target registry and repository before
they can be pushed

```
Expand Down Expand Up @@ -341,37 +341,37 @@ Create a tag that refers to a modelkit

Create or update a tag <target-modelkit> that refers to <source-modelkit>

This command assigns a new tag to an existing modelkit (source-modelkit) or
updates an existing tag, effectively renaming or categorizing modelkits for
This command assigns a new tag to an existing modelkit (source-modelkit) or
updates an existing tag, effectively renaming or categorizing modelkits for
better organization and version control. Tags are identifiers linked to specific
modelkit versions within a repository.

A full modelkit reference has the following format:
A full modelkit reference has the following format:

[HOST[:PORT_NUMBER]/][NAMESPACE/]REPOSITORY[:TAG]

* HOST: Optional. The registry hostname where the ModelKit is located. Defaults
to localhost if unspecified. Must follow standard DNS rules
to localhost if unspecified. Must follow standard DNS rules
(excluding underscores).

* PORT_NUMBER: Optional. Specifies the registry's port number if a hostname is
* PORT_NUMBER: Optional. Specifies the registry's port number if a hostname is
provided.

* NAMESPACE: Represents a user or organization's namespace, consisting of
slash-separated components that may include lowercase letters, digits, and
* NAMESPACE: Represents a user or organization's namespace, consisting of
slash-separated components that may include lowercase letters, digits, and
specific separators (periods, underscores, hyphens).
* REPOSITORY: The name of the repository, typically corresponding to the

* REPOSITORY: The name of the repository, typically corresponding to the
modelkit's name.

* TAG: A human-readable identifier for the modelkit version or variant. Valid
* TAG: A human-readable identifier for the modelkit version or variant. Valid
ASCII characters include lowercase and uppercase letters, digits, underscores,
periods, and hyphens. It cannot start with a period or hyphen and is limited
periods, and hyphens. It cannot start with a period or hyphen and is limited
to 128 characters.

Tagging is a powerful way to manage different versions or configurations of your
modelkits, making it easier to organize, retrieve, and deploy specific
iterations. Ensure tags are meaningful and consistent across your team or
modelkits, making it easier to organize, retrieve, and deploy specific
iterations. Ensure tags are meaningful and consistent across your team or
organization to maintain clarity and avoid confusion.

```
Expand Down Expand Up @@ -405,8 +405,8 @@ Display the version information for the CLI

The version command prints detailed version information.

This information includes the current version of the tool, the Git commit that
the version was built from, the build time, and the version of Go it was
This information includes the current version of the tool, the Git commit that
the version was built from, the build time, and the version of Go it was
compiled with.

```
Expand Down
6 changes: 3 additions & 3 deletions docs/src/docs/cli/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation Guide for `kit` CLI
# Installation Guide for `kit` CLI

## Installation from GitHub Releases
## Installation from GitHub Releases
Welcome to the installation guide for the `kit`! This guide is designed to help you quickly and easily install the `kit` on your machine.

### Step 1: Downloading the `kit`
Expand Down Expand Up @@ -93,7 +93,7 @@ This command should display the version number of `kit` you have installed, indi

## Installation from Source

For those who prefer or require building `kit` from the source code, this section will guide you through the necessary steps.
For those who prefer or require building `kit` from the source code, this section will guide you through the necessary steps.

### Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/kitfile/kf-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Kitfiles

A Kitfile is a manifest showing what is in
A Kitfile is a manifest showing what is in
4 changes: 2 additions & 2 deletions pkg/artifact/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A **ModelKit** represents a comprehensive bundle of AI/ML artifacts, including m

**Artifacts:** The building blocks of a ModelKit. Artifacts can be models, datasets, or code, each stored and addressed individually. This modular approach facilitates direct access via tools. Artifact metadata is encapsulated within the kitfile, ensuring comprehensive documentation of each component.

The artifacts and their media types are
The artifacts and their media types are
* Serialized Model: `application/vnd.kitops.modelkit.model.v1.tar+gzip`
* Datasets: `application/vnd.kitops.modelkit.dataset.v1.tar+gzip`
* Code: `application/vnd.kitops.modelkit.code.v1.tar+gzip`
Expand All @@ -28,7 +28,7 @@ The artifacts and their media types are

## ModelKit Manifest Example

Example of a ModelKit manifest with a single serialized model and kitfile.
Example of a ModelKit manifest with a single serialized model and kitfile.

```JSON
{
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/build/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import (

const (
shortDesc = `Builds a modelkit`
longDesc = `Build a modelkit from a kitfile using the given context directory.
longDesc = `Build a modelkit from a kitfile using the given context directory.
The build process involves taking the configuration and resources defined in
The build process involves taking the configuration and resources defined in
your kitfile and using them to create a modelkit. This modelkit is then stored
in your local registry, making it readily available for further actions such
in your local registry, making it readily available for further actions such
as pushing to a remote registry for collaboration.
Unless a different location is specified, this command looks for the k itfile
at the root of the provided context directory. Any relative paths defined
Unless a different location is specified, this command looks for the k itfile
at the root of the provided context directory. Any relative paths defined
within the kitfile are interpreted as being relative to this context directory.`

examples = `# Build a modelkit using the kitfile in the current directory
Expand Down
12 changes: 6 additions & 6 deletions pkg/cmd/export/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
const (
shortDesc = `Produce the components from a modelkit on the local filesystem`
longDesc = `Produces all or selected components of a modelkit on the local filesystem.
This command exports a modelkit's components, including models, code, datasets,
and configuration files, to a specified directory on the local filesystem.
By default, it attempts to find the modelkit in local storage; if not found, it
searches the remote registry and retrieves it. This process ensures that the
necessary components are always available for export, optimizing for efficiency
This command exports a modelkit's components, including models, code, datasets,
and configuration files, to a specified directory on the local filesystem.
By default, it attempts to find the modelkit in local storage; if not found, it
searches the remote registry and retrieves it. This process ensures that the
necessary components are always available for export, optimizing for efficiency
by fetching only specified components from the remote registry when necessary`

example = `# Export all components of a modelkit to the current directory
Expand Down
Loading

0 comments on commit 0413fb0

Please sign in to comment.