Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: loeffel-io/ls-lint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.3
Choose a base ref
...
head repository: loeffel-io/ls-lint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.3.0
Choose a head ref

Commits on Mar 15, 2024

  1. Copy the full SHA
    8894ba8 View commit details

Commits on Mar 24, 2024

  1. Copy the full SHA
    a8e466d View commit details
  2. chore: bump license date

    loeffel-io committed Mar 24, 2024
    Copy the full SHA
    0943fc0 View commit details
  3. Merge pull request #215 from loeffel-io/feature/loeffel-io/187-lint-i…

    …ndividual-files
    
    feat: allow specifying individual files and directories
    loeffel-io authored Mar 24, 2024
    Copy the full SHA
    e1a93d0 View commit details
  4. Copy the full SHA
    5b08ef5 View commit details
  5. Merge pull request #216 from loeffel-io/feature/loeffel-io/203-output…

    …-format-json
    
    feat: add error-output-format option
    loeffel-io authored Mar 24, 2024
    Copy the full SHA
    2876929 View commit details
  6. Copy the full SHA
    61609d8 View commit details
  7. Copy the full SHA
    e47c90c View commit details
  8. Merge pull request #214 from loeffel-io/renovate/gcr.io-bazel-public-…

    …bazel
    
    chore(deps): update gcr.io/bazel-public/bazel docker digest to 7430f06
    loeffel-io authored Mar 24, 2024
    Copy the full SHA
    076689c View commit details
  9. Copy the full SHA
    5bb6f11 View commit details
  10. Merge pull request #213 from loeffel-io/renovate/bazel-7.x

    chore(deps): update dependency bazel to v7.1.1
    loeffel-io authored Mar 24, 2024
    Copy the full SHA
    0252061 View commit details
  11. Copy the full SHA
    6889060 View commit details
  12. Copy the full SHA
    6453d8f View commit details
  13. Copy the full SHA
    2f80491 View commit details
  14. Merge pull request #210 from loeffel-io/renovate/aspect_rules_js-1.x

    chore(deps): update dependency aspect_rules_js to v1.39.1
    loeffel-io authored Mar 24, 2024
    Copy the full SHA
    c7fc0aa View commit details
  15. Merge pull request #212 from loeffel-io/renovate/com_github_cli_cli_l…

    …inux_amd64-2.x
    
    chore(deps): update dependency com_github_cli_cli_linux_amd64 to v2.46.0
    loeffel-io authored Mar 24, 2024
    Copy the full SHA
    03cdb7c View commit details
  16. Merge pull request #211 from loeffel-io/renovate/com_github_cli_cli_d…

    …arwin_arm64-2.x
    
    chore(deps): update dependency com_github_cli_cli_darwin_arm64 to v2.46.0
    loeffel-io authored Mar 24, 2024
    Copy the full SHA
    174da86 View commit details

Commits on Mar 25, 2024

  1. Copy the full SHA
    ef49b65 View commit details

Commits on Apr 22, 2024

  1. Merge pull request #217 from loeffel-io/feature/loeffel-io/56-wildcar…

    …d-extensions
    
    feat: add wildcard extension support
    loeffel-io authored Apr 22, 2024
    Copy the full SHA
    60cf127 View commit details
  2. Copy the full SHA
    5a8158d View commit details
  3. Copy the full SHA
    e14fc6c View commit details
  4. Merge pull request #218 from loeffel-io/renovate/aspect_rules_js-1.x

    chore(deps): update dependency aspect_rules_js to v1.41.2
    loeffel-io authored Apr 22, 2024
    Copy the full SHA
    cbd43f0 View commit details
  5. Copy the full SHA
    ccce172 View commit details
  6. Merge pull request #222 from loeffel-io/renovate/golang.org-x-sync-0.x

    fix(deps): update module golang.org/x/sync to v0.7.0
    loeffel-io authored Apr 22, 2024
    Copy the full SHA
    2bf7f4e View commit details
  7. Copy the full SHA
    fc47542 View commit details
  8. Copy the full SHA
    40e7def View commit details
  9. Copy the full SHA
    92a086a View commit details
  10. Merge pull request #221 from loeffel-io/renovate/com_github_cli_cli_l…

    …inux_amd64-2.x
    
    chore(deps): update dependency com_github_cli_cli_linux_amd64 to v2.48.0
    loeffel-io authored Apr 22, 2024
    Copy the full SHA
    46c0250 View commit details
  11. Merge pull request #220 from loeffel-io/renovate/com_github_cli_cli_d…

    …arwin_arm64-2.x
    
    chore(deps): update dependency com_github_cli_cli_darwin_arm64 to v2.48.0
    loeffel-io authored Apr 22, 2024
    Copy the full SHA
    d3f4133 View commit details
  12. Copy the full SHA
    cbf51d1 View commit details
  13. Copy the full SHA
    2fbcbde View commit details
  14. Merge pull request #219 from loeffel-io/renovate/bazel_gazelle-0.x

    chore(deps): update dependency bazel_gazelle to v0.36.0
    loeffel-io authored Apr 22, 2024
    Copy the full SHA
    7174339 View commit details
  15. chore: bump deps

    loeffel-io committed Apr 22, 2024
    Copy the full SHA
    ceb1d8e View commit details

Commits on Apr 23, 2024

  1. Copy the full SHA
    cc3e80d View commit details
  2. Copy the full SHA
    fe62af3 View commit details

Commits on Jun 13, 2024

  1. Copy the full SHA
    2236997 View commit details

Commits on Jul 9, 2024

  1. Update README.md

    loeffel-io authored Jul 9, 2024
    Copy the full SHA
    16c31a0 View commit details

Commits on Jul 10, 2024

  1. Copy the full SHA
    92db1bd View commit details

Commits on Jul 11, 2024

  1. feat: fix directory exists

    loeffel-io committed Jul 11, 2024
    Copy the full SHA
    c79f0f5 View commit details
  2. feat: selected files/dirs

    loeffel-io committed Jul 11, 2024
    Copy the full SHA
    21d81e8 View commit details
  3. chore: remove debug

    loeffel-io committed Jul 11, 2024
    Copy the full SHA
    d455a78 View commit details
  4. Copy the full SHA
    aa1433d View commit details
  5. feat: add some more tests

    loeffel-io committed Jul 11, 2024
    Copy the full SHA
    faf2983 View commit details
  6. feat: use stable sort func

    loeffel-io committed Jul 11, 2024
    Copy the full SHA
    457659f View commit details
  7. feat: extend tests

    loeffel-io committed Jul 11, 2024
    Copy the full SHA
    b23184d View commit details
  8. chore: review improvements

    loeffel-io committed Jul 11, 2024
    Copy the full SHA
    6158e85 View commit details
  9. Copy the full SHA
    17f81f8 View commit details
  10. Copy the full SHA
    888a537 View commit details
  11. Copy the full SHA
    fb0e68a View commit details
  12. Copy the full SHA
    b444360 View commit details
Showing with 1,842 additions and 2,123 deletions.
  1. +1 −1 .bazelversion
  2. +23 −7 .github/workflows/bazel.yml
  3. +1 −1 .github/workflows/github-action.yml
  4. +20 −7 .ls-lint.yml
  5. +11 −3 BUILD.bazel
  6. +1 −1 LICENSE
  7. +103 −6 MODULE.bazel
  8. +303 −1,554 MODULE.bazel.lock
  9. +15 −14 README.md
  10. +0 −153 WORKSPACE
  11. +3 −1 cmd/ls_lint/BUILD.bazel
  12. +89 −33 cmd/ls_lint/main.go
  13. +4 −1 cmd/ls_lint/target.bzl
  14. +1 −1 deployments/github/github.sh
  15. +5 −0 deployments/npm/BUILD.bazel
  16. +2 −0 deployments/npm/bin/cli.js
  17. +2 −1 deployments/npm/package.json
  18. +3 −3 go.mod
  19. +4 −4 go.sum
  20. +1 −1 internal/config/BUILD.bazel
  21. +16 −21 internal/config/config.go
  22. +9 −8 internal/config/config_test.go
  23. +1 −1 internal/debug/BUILD.bazel
  24. +1 −1 internal/flag/BUILD.bazel
  25. +2 −1 internal/glob/BUILD.bazel
  26. +52 −3 internal/glob/glob.go
  27. +1 −1 internal/linter/BUILD.bazel
  28. +177 −55 internal/linter/linter.go
  29. +467 −9 internal/linter/linter_test.go
  30. +3 −3 internal/rule/BUILD.bazel
  31. +19 −6 internal/rule/camelcase.go
  32. +10 −7 internal/rule/camelcase_test.go
  33. +16 −0 internal/rule/error.go
  34. +159 −0 internal/rule/exists.go
  35. +81 −0 internal/rule/exists_test.go
  36. +19 −6 internal/rule/kebabcase.go
  37. +10 −7 internal/rule/kebabcase_test.go
  38. +19 −6 internal/rule/lowercase.go
  39. +10 −7 internal/rule/lowercase_test.go
  40. +19 −6 internal/rule/pascalcase.go
  41. +10 −7 internal/rule/pascalcase_test.go
  42. +0 −57 internal/rule/pointcase.go
  43. +0 −38 internal/rule/pointcase_test.go
  44. +64 −12 internal/rule/regex.go
  45. +19 −12 internal/rule/regex_test.go
  46. +10 −5 internal/rule/rule.go
  47. +19 −6 internal/rule/screamingsnakecase.go
  48. +7 −6 internal/rule/screamingsnakecase_test.go
  49. +19 −6 internal/rule/snakecase.go
  50. +10 −7 internal/rule/snakecase_test.go
  51. +1 −0 nogo.json
  52. +0 −27 repositories.bzl
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.0
8.1.1
30 changes: 23 additions & 7 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Bazel
on: [ push ]
on: [ push, pull_request ]

jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
container:
image: gcr.io/bazel-public/bazel@sha256:75cb96556a69f422296cb85699a7db8782c76105fdbe39b74ca4b39dc7102311
options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
image: gcr.io/bazel-public/bazel@sha256:62d6f3299bef1495cb4744960e315a3dcf158a6330093b51a977431b512c78a4
options: --user root
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel
@@ -15,28 +17,42 @@ jobs:
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //:gazelle_fix_diff
- 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}

build-no-cache: # external pull requests
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
container:
image: gcr.io/bazel-public/bazel@sha256:62d6f3299bef1495cb4744960e315a3dcf158a6330093b51a977431b512c78a4
options: --user root
steps:
- run: set -eu
- uses: actions/checkout@v4
- run: bazel run //:gazelle_fix_diff
- run: bazel test //...
- run: bazel build //...
- 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:75cb96556a69f422296cb85699a7db8782c76105fdbe39b74ca4b39dc7102311
image: gcr.io/bazel-public/bazel@sha256:62d6f3299bef1495cb4744960e315a3dcf158a6330093b51a977431b512c78a4
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
- run: set -eu
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
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_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc npm publish --no-git-checks) # workaround: https://bazelbuild.slack.com/archives/CEZUUKQ6P/p1667995025343689 # --dry-run --tag beta
- run: NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint.publish
2 changes: 1 addition & 1 deletion .github/workflows/github-action.yml
Original file line number Diff line number Diff line change
@@ -5,4 +5,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ls-lint/action@v2.2.2
- uses: ls-lint/action@v2.3.0-beta.3
27 changes: 20 additions & 7 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
ls:
.dir: snake_case
.bzl: snake_case
.sh: snake_case
.*: snake_case
.*.*: snake_case
.*.*.*: exists:0
.png: exists:0
.jpg: exists:0
.md: SCREAMING_SNAKE_CASE
.bazel: SCREAMING_SNAKE_CASE
.go: snake_case
.yaml: snake_case
.js: snake_case
.bazel.lock: SCREAMING_SNAKE_CASE

examples/**: # allow only .yml files
.dir: snake_case
.*: exists:0
.yml: kebab-case

assets/**: # allow only .png files
.dir: snake_case
.*: exists:0
.png: kebab-case

ignore:
- .git
- .github
- .idea
- genhtml
- bazel-*
- deployments/npm/pnpm-lock.yaml
- gha-*
- deployments/npm/pnpm-lock.yaml
- deployments/docker
14 changes: 11 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "TOOLS_NOGO", "nogo")
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "nogo")

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

gazelle(
name = "gazelle_fix_diff",
command = "fix",
extra_args = ["--mode=diff"],
)

config_setting(
name = "darwin_arm64",
constraint_values = [
@@ -16,7 +24,7 @@ nogo(
name = "nogo",
config = ":nogo.json",
visibility = ["//visibility:public"],
deps = TOOLS_NOGO + [],
deps = [], # TOOLS_NOGO: https://github.com/bazel-contrib/rules_go/issues/3924
)

exports_files(
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-2023 Lucas Löffel
Copyright (c) 2020-2025 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
109 changes: 103 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,103 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
bazel_dep(name = "platforms", version = "0.0.11", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.53.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.42.0", dev_dependency = True)
bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True)
bazel_dep(name = "aspect_bazel_lib", version = "2.14.0", dev_dependency = True)
bazel_dep(name = "aspect_rules_js", version = "2.3.3", dev_dependency = True)

####################################################################
# rules_go #########################################################
####################################################################

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.24.1")
go_sdk.nogo(nogo = "//:nogo")

####################################################################
# gazelle ##########################################################
# upgrade with bazel run @rules_go//go mod tidy && bazel mod tidy ##
####################################################################

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_bmatcuk_doublestar_v4",
"in_gopkg_yaml_v3",
"org_golang_x_sync",
)

####################################################################
# rules_js #########################################################
####################################################################

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
npmrc = "//deployments/npm:.npmrc",
pnpm_lock = "//deployments/npm:pnpm-lock.yaml",
)
use_repo(npm, "npm")

####################################################################
# rules_python #####################################################
# https://github.com/bazelbuild/rules_python/pull/713 ##############
####################################################################

bazel_dep(name = "rules_python", version = "1.2.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
ignore_root_user_error = True,
python_version = "3.13",
)

####################################################################
# github cli #######################################################
####################################################################

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "com_github_cli_cli_darwin_arm64",
build_file_content = """exports_files(glob(["bin/*"]))""",
sha256 = "fdb77f31b8a6dd23c3fd858758d692a45f7fc76383e37d475bdcae038df92afc",
strip_prefix = "gh_2.62.0_macOS_arm64",
urls = [
"https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_macOS_arm64.zip",
],
)

http_archive(
name = "com_github_cli_cli_linux_amd64",
build_file_content = """exports_files(glob(["bin/*"]))""",
sha256 = "41c8b0698ad3003cb5c44bde672a1ffd5f818595abd80162fbf8cc999418446a",
strip_prefix = "gh_2.62.0_linux_amd64",
urls = [
"https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_linux_amd64.tar.gz",
],
)

####################################################################
# coreutils (sha256) ###############################################
####################################################################

http_archive(
name = "com_github_uutils_coreutils_darwin_arm64",
build_file_content = """exports_files(["coreutils"])""",
sha256 = "bbd9b97fc38b9e8841feb93b5684f3587afb3d651a1cc91e46d00b1b0bcf28f6",
strip_prefix = "coreutils-0.0.28-aarch64-apple-darwin",
urls = [
"https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-aarch64-apple-darwin.tar.gz",
],
)

http_archive(
name = "com_github_uutils_coreutils_linux_amd64",
build_file_content = """exports_files(["coreutils"])""",
sha256 = "e22a4a9179bbde667865917dc1399e4686a18159da35be6c1b78582c52a373a2",
strip_prefix = "coreutils-0.0.28-x86_64-unknown-linux-gnu",
urls = [
"https://github.com/uutils/coreutils/releases/download/0.0.28/coreutils-0.0.28-x86_64-unknown-linux-gnu.tar.gz",
],
)
Loading