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

lint: use dprint for formatting #240

Merged
merged 3 commits into from
Apr 3, 2024
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
71 changes: 71 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"[dockerfile]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[javascript]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[json]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[jsonc]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[markdown]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[typescript]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[yaml]": {
"editor.defaultFormatter": "dprint.dprint"
},
"cSpell.advanced.feature.useReferenceProviderWithRename": true,
"cSpell.checkOnlyEnabledFileTypes": false,
"cSpell.numSuggestions": 3,
"cSpell.showAutocompleteSuggestions": true,
"eslint.enable": true,
"eslint.options": {
"cache": true,
"cacheLocation": "./node_modules/.cache/eslint/",
"errorOnUnmatchedPattern": false,
"extensions": [
"ts",
"tsx",
"js",
"jsx",
"cjs",
"mjs",
"json",
"yaml",
"astro",
"mdx",
"html"
]
},
"eslint.probe": [
"typescript",
"typescriptreact",
"javascript",
"javascriptreact",
"json",
"jsonc",
"yaml",
"markdown",
"html",
"astro"
],
"explorer.copyRelativePathSeparator": "/",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"hadolint.hadolintPath": "./target/bin/hadolint",
// use dprint instead
"prettier.enable": false
}
2 changes: 2 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ignorePaths:
- .vscode/extensions.json
words:
- aarch
- hadolint
- aminya
- applellvm
- bazel
Expand All @@ -33,6 +34,7 @@ words:
- dearmor
- deps
- devel
- dprint
- DVCPKG
- dyld
- eabi
Expand Down
9 changes: 4 additions & 5 deletions dev/docker/ci/arch-llvm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch
FROM archlinux:base AS setup-cpp-arch

COPY "./dist/legacy" "/usr/lib/setup-cpp/"

RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \

# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler llvm \
--cmake true \
Expand All @@ -21,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*
Expand Down
9 changes: 4 additions & 5 deletions dev/docker/ci/arch-mingw.dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch-mingw
FROM archlinux:base AS setup-cpp-arch-mingw

COPY "./dist/legacy" "/usr/lib/setup-cpp/"

RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \

# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler mingw \
--cmake true \
Expand All @@ -21,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*
Expand Down
2 changes: 1 addition & 1 deletion dev/docker/ci/docker-ci.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function main() {
.replace(/FROM (.*)/g, `FROM $1\n\nCOPY "./dist/legacy" "/usr/lib/setup-cpp/"`)
.replace("setup-cpp ", "node /usr/lib/setup-cpp/setup-cpp.js ")
// remove the npm install line
.replace(/# install setup-cpp\n\s*npm install -g setup-cpp.*/, "")
.replace(/# install setup-cpp\n\s*npm install -g setup-cpp.*\n/, "")

// write the new file in dev/docker/ci
await writeFile(`./dev/docker/ci/${name}.dockerfile`, modifiedDockerFile)
Expand Down
7 changes: 3 additions & 4 deletions dev/docker/ci/fedora-llvm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora
FROM fedora:40 AS setup-cpp-fedora

COPY "./dist/legacy" "/usr/lib/setup-cpp/"

# install nodejs
RUN dnf -y install nodejs npm && \

# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler llvm \
--cmake true \
Expand All @@ -19,7 +18,7 @@ RUN dnf -y install nodejs npm && \
--gcovr true \
--doxygen true \
--ccache true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

Expand Down
7 changes: 3 additions & 4 deletions dev/docker/ci/fedora-mingw.dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora-mingw
FROM fedora:40 AS setup-cpp-fedora-mingw

COPY "./dist/legacy" "/usr/lib/setup-cpp/"

# install nodejs
RUN dnf -y install nodejs npm && \

# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler mingw \
--cmake true \
Expand All @@ -20,7 +19,7 @@ RUN dnf -y install nodejs npm && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

Expand Down
9 changes: 4 additions & 5 deletions dev/docker/ci/ubuntu-llvm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#### Base Image
FROM ubuntu:22.04 as setup-cpp-ubuntu
FROM ubuntu:22.04 AS setup-cpp-ubuntu

COPY "./dist/legacy" "/usr/lib/setup-cpp/"

RUN apt-get update -qq && \
# install nodejs
# install nodejs
apt-get install -y --no-install-recommends nodejs npm && \

# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--nala true \
--compiler llvm \
Expand All @@ -21,7 +20,7 @@ RUN apt-get update -qq && \
--gcovr true \
--doxygen true \
--ccache true && \
# cleanup
# cleanup
nala autoremove -y && \
nala autopurge -y && \
apt-get clean && \
Expand Down
9 changes: 4 additions & 5 deletions dev/docker/ci/ubuntu-mingw.dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#### Base Image
FROM ubuntu:22.04 as setup-cpp-ubuntu-mingw
FROM ubuntu:22.04 AS setup-cpp-ubuntu-mingw

COPY "./dist/legacy" "/usr/lib/setup-cpp/"

RUN apt-get update -qq && \
# install nodejs
# install nodejs
apt-get install -y --no-install-recommends nodejs npm && \

# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--nala true \
--compiler mingw \
Expand All @@ -22,7 +21,7 @@ RUN apt-get update -qq && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
nala autoremove -y && \
nala autopurge -y && \
apt-get clean && \
Expand Down
2 changes: 1 addition & 1 deletion dev/docker/examples/arch-llvm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN bash -c 'source ~/.cpprc \

#### Running environment
# use a fresh image as the runner
FROM archlinux:base as runner
FROM archlinux:base AS runner

# copy the built binaries and their runtime dependencies
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
Expand Down
2 changes: 1 addition & 1 deletion dev/docker/examples/fedora-llvm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN bash -c 'source ~/.cpprc \

#### Running environment
# use a fresh image as the runner
FROM fedora:40 as runner
FROM fedora:40 AS runner

# copy the built binaries and their runtime dependencies
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
Expand Down
2 changes: 1 addition & 1 deletion dev/docker/examples/ubuntu-llvm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN bash -c 'source ~/.cpprc \

#### Running environment
# use a fresh image as the runner
FROM ubuntu:22.04 as runner
FROM ubuntu:22.04 AS runner

# copy the built binaries and their runtime dependencies
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
Expand Down
10 changes: 5 additions & 5 deletions dev/docker/setup-cpp/setup-cpp-arch-llvm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch
FROM archlinux:base AS setup-cpp-arch

RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g [email protected] && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler llvm \
--cmake true \
Expand All @@ -20,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*
Expand Down
10 changes: 5 additions & 5 deletions dev/docker/setup-cpp/setup-cpp-arch-mingw.dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch-mingw
FROM archlinux:base AS setup-cpp-arch-mingw

RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g [email protected] && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler mingw \
--cmake true \
Expand All @@ -20,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*
Expand Down
8 changes: 4 additions & 4 deletions dev/docker/setup-cpp/setup-cpp-fedora-llvm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora
FROM fedora:40 AS setup-cpp-fedora

# install nodejs
RUN dnf -y install nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g [email protected] && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler llvm \
--cmake true \
Expand All @@ -18,7 +18,7 @@ RUN dnf -y install nodejs npm && \
--gcovr true \
--doxygen true \
--ccache true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

Expand Down
8 changes: 4 additions & 4 deletions dev/docker/setup-cpp/setup-cpp-fedora-mingw.dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora-mingw
FROM fedora:40 AS setup-cpp-fedora-mingw

# install nodejs
RUN dnf -y install nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g [email protected] && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler mingw \
--cmake true \
Expand All @@ -19,7 +19,7 @@ RUN dnf -y install nodejs npm && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

Expand Down
Loading
Loading