Skip to content

Commit

Permalink
Merge pull request #89 from loeffel-io/feature/loeffel-io/v2
Browse files Browse the repository at this point in the history
v2
  • Loading branch information
loeffel-io committed May 21, 2023
2 parents a428e23 + 858a412 commit 36ae2fa
Show file tree
Hide file tree
Showing 62 changed files with 1,119 additions and 741 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --stamp --workspace_status_command="bash scripts/bazel/workspace_status.sh"
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.2.0
155 changes: 0 additions & 155 deletions .drone.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: gcr.io/bazel-public/bazel@sha256:7318b89458263c20e9b98ac7864769ba68bb86ff2dd33980b42ee33a1591df17 # v6.2.0
options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel
steps:
- run: set -eu
- uses: actions/checkout@v3
- uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //...
- run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //...
- run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD}

release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
container:
image: gcr.io/bazel-public/bazel@sha256:7318b89458263c20e9b98ac7864769ba68bb86ff2dd33980b42ee33a1591df17 # v6.2.0
options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
env:
GH_TOKEN: ${{ github.token }}
STABLE_GIT_TAG: ${{ github.ref_name }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel
steps:
- run: set -eu && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
- uses: actions/checkout@v3
- uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish
- run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint
- run: (cd bazel-bin/deployments/npm/ls_lint && npm publish --tag beta --no-git-checks) # workaround: https://bazelbuild.slack.com/archives/CEZUUKQ6P/p1667995025343689 # --dry-run
17 changes: 8 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# vendor/

# custom
/.idea
ls-lint
ls-lint-darwin
ls-lint-darwin-arm64
ls-lint-linux
ls-lint-linux-arm64
ls-lint-windows.exe
/coverage.txt
!npm
.DS_Store
.idea
bazel-bin
bazel-ls-lint
bazel-out
bazel-testlogs
genhtml
gha-creds-*.json
15 changes: 13 additions & 2 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
ls:
.dir: kebab-case
.dir: snake_case
.bzl: snake_case
.sh: snake_case
.bazel: SCREAMING_SNAKE_CASE
.go: snake_case
.yaml: snake_case
.js: snake_case

ignore:
- .git
- .idea
- .github
- .git
- genhtml
- bazel-bin
- bazel-out
- bazel-ls-lint
- bazel-testlogs
- deployments/npm/pnpm-lock.yaml
46 changes: 46 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "TOOLS_NOGO", "nogo")

# gazelle:prefix github.com/loeffel-io/ls-lint/v2
gazelle(name = "gazelle")

config_setting(
name = "darwin_arm64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:arm64",
],
)

nogo(
name = "nogo",
config = ":nogo.json",
visibility = ["//visibility:public"],
deps = TOOLS_NOGO + [],
)

exports_files(
srcs = [
"LICENSE",
"README.md",
],
visibility = ["//visibility:public"],
)

alias(
name = "gh",
actual = select({
":darwin_arm64": "@com_github_cli_cli_darwin_arm64//:bin/gh",
"//conditions:default": "@com_github_cli_cli_linux_amd64//:bin/gh",
}),
visibility = ["//visibility:public"],
)

alias(
name = "coreutils",
actual = select({
":darwin_arm64": "@com_github_uutils_coreutils_darwin_arm64//:coreutils",
"//conditions:default": "@com_github_uutils_coreutils_linux_amd64//:coreutils",
}),
visibility = ["//visibility:public"],
)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2022 Lucas Löffel
Copyright (c) 2020-2023 Lucas Löffel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 0 additions & 49 deletions Makefile

This file was deleted.

10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

An extremely fast directory and filename linter - Bring some structure to your project directories

[![Build Status](https://cloud.drone.io/api/badges/loeffel-io/ls-lint/status.svg)](https://cloud.drone.io/loeffel-io/ls-lint)
[![CI](https://github.com/loeffel-io/ls-lint/actions/workflows/bazel.yml/badge.svg?branch=master)](https://github.com/loeffel-io/ls-lint/actions/workflows/bazel.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/loeffel-io/ls-lint)](https://goreportcard.com/report/github.com/loeffel-io/ls-lint)
<a href="https://www.npmjs.com/package/@ls-lint/ls-lint"><img src="https://img.shields.io/npm/v/@ls-lint/ls-lint.svg?sanitize=true" alt="Version"></a>
[![codecov](https://codecov.io/gh/loeffel-io/ls-lint/branch/master/graph/badge.svg?token=76N7CNQT2G)](https://codecov.io/gh/loeffel-io/ls-lint)
<a href="https://www.npmjs.com/package/@ls-lint/ls-lint"><img src="https://img.shields.io/npm/dm/@ls-lint/ls-lint?label=npm%20downloads" alt="NPM Downloads"></a>
![npm](https://img.shields.io/npm/dt/@ls-lint/ls-lint?label=npm%20downloads%20total)
<a href="https://www.npmjs.com/package/@ls-lint/ls-lint"><img src="https://img.shields.io/npm/l/@ls-lint/ls-lint.svg?sanitize=true" alt="License"></a>
Expand All @@ -16,7 +15,6 @@ An extremely fast directory and filename linter - Bring some structure to your p
- Works for directory and file names - all extensions supported - full unicode support
- Incredibly fast - lints thousands of files and directories in milliseconds
- Support for Windows, MacOS and Linux + NPM Package & Docker Image
- ARM support
- Almost zero third-party dependencies (only [go-yaml](https://github.com/go-yaml/yaml)
and [doublestar](https://github.com/bmatcuk/doublestar))

Expand Down Expand Up @@ -48,12 +46,6 @@ ignore:

<img src="https://i.imgur.com/pxXkYcl.gif" alt="command" width="600">

## Benchmarks ([hyperfine](https://github.com/sharkdp/hyperfine))

| Package | v1.10.x: Mean [s] | v1.11.x: Mean [s] | File |
|--------------------------------------------------|--------------------|--------------------|---------------------------------------------------------------------------------------------------------------|
| [nuxt/nuxt.js](https://github.com/nuxt/nuxt.js) | 627.2 ms ± 19.0 ms | 51.9 ms ± 3.2 ms | [examples/nuxt-nuxt-js](https://github.com/loeffel-io/ls-lint/tree/master/examples/nuxt-nuxt-js/.ls-lint.yml) |

## Discord

[Join the ls-lint discord server](https://discord.gg/bsf9q7f2Rh)
Expand Down
Loading

0 comments on commit 36ae2fa

Please sign in to comment.