Skip to content

Commit

Permalink
chore(scripts): Reorder script names (#530)
Browse files Browse the repository at this point in the history
- Script names are now as follow: [purpose]:[scope]
- Rename `install-deps` to `install:deps`
- Rename `lint-staged` to `lint:staged`
- Rename `elixir:eex` to `eex`
- Rename `elixir-for-workspace.txt` to `elixir-custom.txt`
- Reenable shellcheck SC2119
- Adapt documentation
  • Loading branch information
aifrak authored Aug 22, 2022
1 parent 852b70f commit 95ad47c
Show file tree
Hide file tree
Showing 25 changed files with 190 additions and 190 deletions.
28 changes: 14 additions & 14 deletions .check.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# —————————————————————————————————————————————— #
# Extends curated tools from ex_check #
# —————————————————————————————————————————————— #
{:credo, "./run elixir:credo", detect: [{:package, :credo}]},
{:credo, "./run lint:elixir:credo", detect: [{:package, :credo}]},
{:dialyzer, "mix dialyzer --format short", detect: [{:package, :dialyxir}]},
{
:doctor,
Expand All @@ -16,8 +16,8 @@
{:elixir, ">= 1.8.0"}
]
},
{:formatter, "./run elixir:format:lint",
detect: [{:file, ".formatter.exs"}], fix: "./run elixir:format"},
{:formatter, "./run lint:elixir:format",
detect: [{:file, ".formatter.exs"}], fix: "./run format:elixir"},
{:npm_test, false},
{
:sobelow,
Expand All @@ -31,16 +31,16 @@
# —————————————————————————————————————————————— #
# Custom tools #
# —————————————————————————————————————————————— #
{:css_lint, "./run css:lint"},
{:dockerfile_lint, "./run dockerfile:lint"},
{:elixir_eex_lint, "./run elixir:eex:lint"},
{:html_lint, "./run html:lint"},
{:js_lint, "./run js:lint"},
{:lint_staged, "./run lint-staged"},
{:markdown_lint, "./run markdown:lint"},
{:prettier_lint, "./run prettier:lint"},
{:release_test, "./run release:test"},
{:shell_lint, "./run shell:lint"},
{:spellcheck_lint, "./run spellcheck:lint"}
{:lint_css, "./run lint:css"},
{:lint_dockerfile, "./run lint:dockerfile"},
{:lint_elixir_eex, "./run lint:eex"},
{:lint_html, "./run lint:html"},
{:lint_js, "./run lint:js"},
{:lint_staged, "./run lint:staged"},
{:lint_markdown, "./run lint:markdown"},
{:lint_prettier, "./run lint:prettier"},
{:lint_shell, "./run lint:shell"},
{:lint_spellcheck, "./run lint:spellcheck"},
{:test_release, "./run test:release"}
]
]
2 changes: 1 addition & 1 deletion .check_ci.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
retry: "mix coveralls.json --failed"
},
{:git_commit_lint, "./run git:commit:lint"},
{:lint_git_commit, "./run lint:git:commit"},
{:lint_staged, false}
]
]
14 changes: 7 additions & 7 deletions .check_format.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
[
tools: [
# Custom tools
{:css_format, "./run css:format"},
{:dockerfile_format, "./run dockerfile:format"},
{:elixir_format, "./run elixir:format"},
{:elixir_eex_format, "./run elixir:eex:format", deps: [:css_format, :js_format]},
{:js_format, "./run js:format"},
{:prettier_format, "./run prettier:format", deps: [:css_format, :js_format]},
{:shell_format, "./run shell:format"}
{:format_css, "./run format:css"},
{:format_dockerfile, "./run format:dockerfile"},
{:format_eex, "./run format:eex", deps: [:format_css, :format_js]},
{:format_elixir, "./run format:elixir"},
{:format_js, "./run format:js"},
{:format_prettier, "./run format:prettier", deps: [:format_css, :format_js]},
{:format_shell, "./run format:shell"}
]
]
2 changes: 1 addition & 1 deletion .devcontainer/setup-dev-env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

./run install-deps
./run install:deps

cat <<EOF
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ jobs:
id: versions
run: |
echo "::set-output name=node::$(./run --dc-ci dc:exec npm -v)"
echo "::set-output name=elixir::$(./run --dc-ci dc:exec ./run elixir:version)"
echo "::set-output name=erlang::$(./run --dc-ci dc:exec ./run erlang:version)"
echo "::set-output name=elixir::$(./run --dc-ci dc:exec ./run version:elixir)"
echo "::set-output name=erlang::$(./run --dc-ci dc:exec ./run version:erlang)"
# —————————————————————————————————————————————— #
# Cache #
Expand Down Expand Up @@ -155,27 +155,27 @@ jobs:
run: |
npm run prepare
- name: Set check flag for git:commit:lint
- name: Set check flag for lint:git:commit
id: git-commit-lint
run: |
is_contributor_dependabot=false
run_git_commit_lint=false
run_lint_git_commit=false
if ./run git:commit:is-contributor-dependabot; then is_contributor_dependabot=true; fi
if ./run is-contributor-dependabot:git:commit; then is_contributor_dependabot=true; fi
if [[ github.actor != "dependabot[bot]" && $is_contributor_dependabot = false ]]; then
run_git_commit_lint=true;
run_lint_git_commit=true;
fi
echo "::set-output name=flag::$run_git_commit_lint"
echo "::set-output name=flag::$run_lint_git_commit"
- name: Compile Elixir application and run all checks
run: |
except_opts=
if [[ ${{ steps.git-commit-lint.outputs.flag }} = false ]]; then
except_opts="--except git_commit_lint"
except_opts="--except lint_git_commit"
fi
./run --dc-ci dc:exec mix check.ci $except_opts
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ if [ "${CI:-false}" = false ] && [ "$branch" = "main" ]; then
fi

if [ -n "$RELEASE" ]; then
./run lint-staged
./run lint:staged
elif [ -n "$INSIDE_DOCKER" ]; then
./run pre-commit
else
./run --dc-dev dc:build
./run --dc-dev dc:up
./run --dc-dev dc:exec ./run install-deps
./run --dc-dev dc:exec ./run install:deps
./run --dc-dev dc:exec ./run pre-commit
fi
32 changes: 16 additions & 16 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
"*":
- ./run spellcheck:lint
- ./run lint:spellcheck

"*.{ex,exs}":
- ./run elixir:credo
- ./run elixir:format:lint
- ./run lint:elixir:credo
- ./run lint:elixir:format

# HACK: "fake1" is a workaround to run different Elixir checks in parallel
# https://github.com/okonet/lint-staged/issues/934#issuecomment-743299357
"*.{ex,exs,fake1}":
- ./run elixir:lint:light
- ./run lint:elixir:light

"*.{css,less,sass,scss}":
- ./run css:lint
- ./run prettier:lint
- ./run lint:css
- ./run lint:prettier

"*.{htm,html}":
- ./run html:lint
- ./run prettier:lint
- ./run lint:html
- ./run lint:prettier

"*.js":
- ./run js:lint
- ./run prettier:lint
- ./run lint:js
- ./run lint:prettier

"*.html.{eex,leex}":
- ./run elixir:eex:lint
- ./run lint:eex

"{run,.husky/*,*.sh}":
- ./run shell:lint
- ./run lint:shell

"Dockerfile*":
- ./run dockerfile:lint
- ./run lint:dockerfile

"*.{json,yaml,yml,htmlhintrc}":
- ./run prettier:lint
- ./run lint:prettier

# CHANGELOG.md text is generated automatically.
# Also, as the file grows, it will take longer to lint and format.
"!(CHANGELOG).md":
- ./run prettier:lint
- ./run markdown:lint
- ./run lint:prettier
- ./run lint:markdown
Loading

0 comments on commit 95ad47c

Please sign in to comment.