Skip to content

Commit

Permalink
ci: create clang-format related features
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir committed Sep 7, 2024
1 parent ef08f4b commit 463c27e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 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
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"
}
11 changes: 11 additions & 0 deletions 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.0",
"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"
}
}

0 comments on commit 463c27e

Please sign in to comment.