-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Build improvements #40
Conversation
New dependencies added: @commitlint/cliAuthor: Mario Nebl Description: Lint your commit messages Homepage: https://github.com/conventional-changelog/commitlint#readme
|
Created | almost 2 years ago |
Last Updated | 30 days ago |
License | MIT |
Maintainers | 4 |
Releases | 23 |
Keywords | conventional-changelog, commitlint, commitlint-config and angular |
README
Lint your conventional commits
@commitlint/config-conventional
Shareable commitlint
config enforcing conventional commits.
Use with @commitlint/cli and @commitlint/prompt-cli.
IMPORTANT | This is a direct replacement for @commitlint/config-angular prior to version 4. config-angular diverged from the conventional commit convention as of version 5. See #146 for details. |
Getting started
npm install --save-dev @commitlint/config-conventional @commitlint/cli
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
Rules
Problems
The following rules are considered problems for @commitlint/config-conventional
and will yield a non-zero exit code when not met.
Consult docs/rules for a list of available rules.
type-enum
-
condition:
type
is found in value -
rule:
always
-
value
[ 'build', 'ci', 'chore', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test' ]
echo "foo: some message" # fails
echo "fix: some message" # passes
type-case
- description:
type
is in casevalue
- rule:
always
- value
'lowerCase'
echo "FIX: some message" # fails
echo "fix: some message" # passes
type-empty
- condition:
type
is empty - rule:
never
echo ": some message" # fails
echo "fix: some message" # passes
scope-case
- condition:
scope
is in casevalue
- rule:
always
'lowerCase'
echo "fix(SCOPE): some message" # fails
echo "fix(scope): some message" # passes
subject-case
- condition:
subject
is in one of the cases['sentence-case', 'start-case', 'pascal-case', 'upper-case']
- rule:
never
echo "fix(SCOPE): Some message" # fails
echo "fix(SCOPE): Some Message" # fails
echo "fix(SCOPE): SomeMessage" # fails
echo "fix(SCOPE): SOMEMESSAGE" # fails
echo "fix(scope): some message" # passes
echo "fix(scope): some Message" # passes
subject-empty
- condition:
subject
is empty - rule:
never
echo "fix:" # fails
echo "fix: some message" # passes
subject-full-stop
- condition:
subject
ends withvalue
- rule:
never
- value
'.'
echo "fix: some message." # fails
echo "fix: some message" # passes
header-max-length
- condition:
header
hasvalue
or less characters - rule:
always
- value
72
echo "fix: some message that is way too long and breaks the line max-length by several characters" # fails
echo "fix: some message" # passes
@seadub/clang-format-lint
Author: Christopher Williams
Description: Validate and/or fix formatting of files via clang-format
Homepage: https://github.com/sgtcoolguy/clang-format-lint#readme
Created | 13 days ago |
Last Updated | 13 days ago |
License | MIT |
Maintainers | 1 |
Releases | 2 |
Direct Dependencies | commander , glob and p-limit |
Keywords | clang, clang-format and lint |
README
clang-format-lint
A very simple wrapper around the clang-format npm package/binary.
Intended to be used to either validate existing files, or automatically fix the formatting on them.
Usage:
npx clang-format-lint [--fix] [--exec-limit [limit]] glob[ glob]*
e.g. To check if your source files match your formatting rules:
npx clang-format-lint android/src/**/*.java
e.g. To ensure your source files match your formatting rules:
npx clang-format-lint --fix android/src/**/*.java
clang-format
Author: Unknown
Description: node wrapper around clang-format
Homepage: https://github.com/angular/clang-format#readme
Created | over 4 years ago |
Last Updated | about 1 year ago |
License | Apache-2.0 |
Maintainers | 3 |
Releases | 63 |
Direct Dependencies | async , glob and resolve |
README
clang-format
node.js module which wraps the native clang-format executable.
From the command-line:
$ npm install -g clang-format
$ clang-format -help
If your platform isn't yet supported, you can create the native binary from
the latest upstream clang sources, make sure it is stripped and optimized
(should be about 1.4MB as of mid-2015) and send a pull request to add it.
Checking formatting
Ensuring that changes to your code are properly formatted is an important part
of your development workflow. We recommend using a git pre-commit hook. You can
configure this as follows:
-
add a
precommit
script to your package.json file:"scripts": { "precommit": "check-clang-format" }
By default, the user gets an error instructing them to run
./node_modules/.bin/git-clang-format
. You may find it more ergonomic to set
up a package.json script, eg.
"scripts": { "format": "git-clang-format" }
In this case, add a second argument to the "precommit" script, giving the
error you'd like to print for users, eg."precommit": "check-clang-format \"yarn format\""
-
Add a devDependency on the
husky
package, which will add a
.git/hooks/pre-commit
script, which in turn triggers theprecommit
package.json script to run whenever someone adds a commit in this repository:$ yarn add -D husky
or
npm install --save-dev husky
Why do this in a pre-commit hook? For one thing, it's faster to run
clang-format
only on the changed files, especially as the repository grows.
Also, this lets you upgradeclang-format
or change your settings without
needing to re-format the entire repository, while still enforcing that later
changes follow the new style.
Globbing files
$ clang-format --glob=folder/**/*.js
This will run clang-format
once per file result, and show the total
formatted files at the end.
See node-glob for globbing semantics.
Compiling clang-format
For Linux, compile a statically linked MinSizeRel build:
cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_BUILD_STATIC=true ..
ninja clang-format
For Mac OS X, static linking is not required.
Windows
Windows snapshot builds to include in the release can be found at the
LLVM website.
Configure with:
cmake -G "Visual Studio 12" -DCMAKE_BUILD_TYPE=MinSizeRel ..
In the generated Visual Studio project, search for the clang-format
binary in
the Solution Explorer window, right click and choose Build.
commitizen
Author: Jim Cummins
Description: Git commit, but play nice with conventions.
Homepage: https://github.com/commitizen/cz-cli
Created | over 4 years ago |
Last Updated | 3 months ago |
License | MIT |
Maintainers | 5 |
Releases | 64 |
Direct Dependencies | cachedir , cz-conventional-changelog , dedent , detect-indent , find-node-modules , find-root , fs-extra , glob , inquirer , is-utf8 , lodash , minimist , shelljs , strip-bom and strip-json-comments |
Keywords | commit, pretty, format, conventional changelog and commitizen |
husky
Author: Typicode
Description: Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)
Homepage: https://github.com/typicode/husky#readme
Created | over 5 years ago |
Last Updated | 4 days ago |
License | MIT |
Maintainers | 1 |
Releases | 133 |
Direct Dependencies | chalk , ci-info , cosmiconfig , execa , get-stdin , opencollective-postinstall , pkg-dir , please-upgrade-node , read-pkg , run-node and slash |
Keywords | git, hook, hooks, pre-commit, precommit, post-commit, postcommit, pre-push, prepush, post-merge, postmerge, test and lint |
lint-staged
Author: Andrey Okonetchnikov
Description: Lint files staged by git
Homepage: https://github.com/okonet/lint-staged#readme
Created | almost 4 years ago |
Last Updated | 9 days ago |
License | MIT |
Maintainers | 1 |
Releases | 111 |
Direct Dependencies | chalk , commander , cosmiconfig , debug , dedent , del , execa , listr , log-symbols , micromatch , normalize-path , please-upgrade-node , string-argv and stringify-object |
Keywords | lint, git, staged, eslint, prettier, stylelint, code, quality, check, format and validate |
This is mainly to try and align native modules and the SDK in enforcing some basic development workflows: conventional commits, clang-format for iOS/Android source, eslint for JS, some basic unit tests, validation of apidocs.
See also tidev/titanium-apple-sign-in#7