Skip to content

Commit

Permalink
ci: create clang-format related features (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir authored Sep 11, 2024
1 parent bdcbe5d commit 834d26e
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: Google
ColumnLimit: 90
15 changes: 15 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# dependencies
node_modules

# production
build
.next

# env
.env
.env.development
.env.production

# tests
.nyc_output
coverage
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ package-lock.json

# markdown
*.md

# cpp
*.c
*.cpp
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[c][cpp]": {
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always",
"source.fixAll.stylelint": "always",
"source.fixAll.markdownlint": "always"
},
"stylelint.validate": ["css", "scss"]
"stylelint.validate": ["css", "scss"],
"C_Cpp.clang_format_fallbackStyle": "Google"
}
14 changes: 13 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"lint-editorconfig": "npx editorconfig-checker",
"lint-markdownlint": "npx markdownlint **/*.md",
"lint-textlint": "npx textlint -f pretty-error src/docs",
"lint-clangformat": "find . -name '*.c' -o -name '*.cpp' -print0 | xargs -0 npx clang-format -n -Werror",
"fix": "concurrently \"npm:fix-*\"",
"fix-eslint": "npx eslint . --fix --ext .js,.jsx",
"fix-stylelint": "npx stylelint --fix **/*.{css,scss}",
"fix-prettier": "npx prettier . --write",
"fix-clangformat": "find . -name '*.c' -o -name '*.cpp' -print0 | xargs -0 npx clang-format -i",
"count-docs": "ls -R src/docs | grep .md | wc -l"
},
"dependencies": {
Expand All @@ -27,6 +29,7 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"clang-format-node": "^1.0.2",
"concurrently": "^8.2.2",
"editorconfig-checker": "^5.1.8",
"eslint": "^8.57.0",
Expand All @@ -51,6 +54,7 @@
"*.{js,jsx}": "npx eslint",
"*.{css,scss}": "npx stylelint",
"*.md": "npx markdownlint",
"src/docs/**/*.md": "npx textlint -f pretty-error"
"src/docs/**/*.md": "npx textlint -f pretty-error",
"*.{c,cpp}": "npx clang-format -n -Werror"
}
}
10 changes: 10 additions & 0 deletions public/code/ps/baekjoon/2558.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <stdio.h>

int main(int argc, char* argv[]) {
int a = 0, b = 0;

scanf("%d %d", &a, &b);
printf("%d", a + b);

return 0;
}

0 comments on commit 834d26e

Please sign in to comment.