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

chore: release alpha #389

Merged
31 commits merged into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
752b944
refactor: remove husky
varl Dec 16, 2020
13f469d
test: drop husky tests
varl Dec 16, 2020
000319b
Merge pull request #332 from dhis2/drop-husky
varl Dec 16, 2020
ea5e7af
chore(release): cut 8.0.0-alpha.1 [skip ci]
dhis2-bot Dec 16, 2020
a3bc415
feat: opt-in git hooks (#333)
varl Dec 16, 2020
9abcbd6
chore(release): cut 8.0.0-alpha.2 [skip ci]
dhis2-bot Dec 16, 2020
25dc168
chore: merge branch 'master' into alpha
varl Dec 16, 2020
127ab7b
chore(release): cut 8.0.0-alpha.3 [skip ci]
dhis2-bot Dec 16, 2020
2c8688d
chore: update readme and remove huskyrc
varl Dec 18, 2020
366be0c
feat: commit check can read from a custom file
varl Dec 18, 2020
9c25383
Merge remote-tracking branch 'origin/master' into alpha
varl Mar 12, 2021
abe4668
feat: show eslint warnings (#368)
varl Mar 15, 2021
e30d0fe
chore(release): cut 8.0.0-alpha.4 [skip ci]
dhis2-bot Mar 15, 2021
f8279e5
feat: new and improved d2-style (#378)
varl Apr 7, 2021
4d858db
chore(release): cut 8.0.0-alpha.5 [skip ci]
dhis2-bot Apr 7, 2021
b77ef35
fix: match files from project root
varl Apr 7, 2021
095c2ce
chore(release): cut 8.0.0-alpha.6 [skip ci]
dhis2-bot Apr 7, 2021
c961647
feat: delete deprecated configuration files
varl Apr 7, 2021
345cc3a
chore(release): cut 8.0.0-alpha.7 [skip ci]
dhis2-bot Apr 7, 2021
2bfb5ef
feat: lint file system for consistent names (#379)
varl Apr 8, 2021
24e686f
chore(release): cut 8.0.0-alpha.8 [skip ci]
dhis2-bot Apr 8, 2021
b81d9bf
refactor: do not use the .d2 directory for config
varl Apr 14, 2021
89fe772
refactor: store hooks in $PROJECT/.hooks
varl Apr 14, 2021
ddcffe0
style: update code style
varl Apr 15, 2021
e804c00
docs: update docs
varl Apr 16, 2021
c95a184
fix: allow eslint to print colors (#384)
varl Apr 21, 2021
de4a977
chore(release): cut 8.0.0-alpha.9 [skip ci]
dhis2-bot Apr 21, 2021
3ac82f4
fix: wrong hooks where installed by default (#385)
varl Apr 22, 2021
6a473f2
fix: ignore .d2 directory (#386)
varl Apr 22, 2021
0770bfe
chore(release): cut 8.0.0-alpha.10 [skip ci]
dhis2-bot Apr 22, 2021
eeb6399
docs: add short intro to the install op
varl May 5, 2021
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
Empty file modified .browserslistrc
100644 → 100755
Empty file.
Empty file modified .editorconfig
100644 → 100755
Empty file.
Empty file modified .eslintrc.js
100644 → 100755
Empty file.
Empty file modified .github/dependabot.yml
100644 → 100755
Empty file.
Empty file modified .github/semantic.yml
100644 → 100755
Empty file.
Empty file modified .github/stale.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/codeql-analysis.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/comment-and-close.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/dhis2-verify-node.yml
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist/
.d2/

# Logs
logs
Expand Down
1 change: 1 addition & 0 deletions .hooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

./bin/d2-style check commit "$1"
4 changes: 4 additions & 0 deletions .hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

./bin/d2-style check
4 changes: 4 additions & 0 deletions .hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn test
12 changes: 0 additions & 12 deletions .huskyrc.js

This file was deleted.

10 changes: 10 additions & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ls:
src:
.dir: kebab-case
.js: kebab-case
.ts: kebab-case
.css: kebab-case
.d.ts: kebab-case

ignore:
- node_modules
Empty file modified .prettierrc.js
100644 → 100755
Empty file.
104 changes: 103 additions & 1 deletion CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,112 @@
# [7.3.0](https://github.com/dhis2/cli-style/compare/v7.2.3...v7.3.0) (2020-12-16)
# [8.0.0-alpha.10](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.9...v8.0.0-alpha.10) (2021-04-22)


### Bug Fixes

* ignore .d2 directory ([#386](https://github.com/dhis2/cli-style/issues/386)) ([6a473f2](https://github.com/dhis2/cli-style/commit/6a473f262503f2816e334d7a2042ea3fba7a2a4c))
* wrong hooks where installed by default ([#385](https://github.com/dhis2/cli-style/issues/385)) ([3ac82f4](https://github.com/dhis2/cli-style/commit/3ac82f4d57031d911ff6c59419f3528e1a66ee40))

# [8.0.0-alpha.9](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.8...v8.0.0-alpha.9) (2021-04-21)


### Bug Fixes

* allow eslint to print colors ([#384](https://github.com/dhis2/cli-style/issues/384)) ([c95a184](https://github.com/dhis2/cli-style/commit/c95a1846c4ee3136cdc9005bd65296bbc1ab2bab))

# [8.0.0-alpha.8](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.7...v8.0.0-alpha.8) (2021-04-08)


### Features

* lint file system for consistent names ([#379](https://github.com/dhis2/cli-style/issues/379)) ([2bfb5ef](https://github.com/dhis2/cli-style/commit/2bfb5ef5ee2b26ff7e27594fe36cef9eb12b2360))

# [8.0.0-alpha.7](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.6...v8.0.0-alpha.7) (2021-04-07)


### Features

* delete deprecated configuration files ([c961647](https://github.com/dhis2/cli-style/commit/c9616479b053d313ccb177688d0bb410d7eef3e2))

# [8.0.0-alpha.6](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.5...v8.0.0-alpha.6) (2021-04-07)


### Bug Fixes

* match files from project root ([b77ef35](https://github.com/dhis2/cli-style/commit/b77ef35678000f9f597b12825b836c035158bc06))

# [8.0.0-alpha.5](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.4...v8.0.0-alpha.5) (2021-04-07)


### Features

* new and improved d2-style ([#378](https://github.com/dhis2/cli-style/issues/378)) ([f8279e5](https://github.com/dhis2/cli-style/commit/f8279e51b7d75033fa3c801721caa4ab1bad18d2))


### BREAKING CHANGES

* The verb (check/apply) is now moved to the top-level. E.g.
"d2-style js check" becomes "d2-style check js". This is to allow all checkers
to run with a single command: "d2-style check"
* "d2-style install" is no longer used to set up linters. As of
husky@5 the tool is vastly simplified and much faster. Hooks can be installed
manually with "d2-style install", but is also run as a "post-install" script
that we control for consistency. Configuration is added to the project with the
"d2-style add" command.

# [8.0.0-alpha.4](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.3...v8.0.0-alpha.4) (2021-03-15)


### Features

* commit check can read from a custom file ([366be0c](https://github.com/dhis2/cli-style/commit/366be0c693f39d2cc18bb546e845f68948ce4b9e))
* show eslint warnings ([#368](https://github.com/dhis2/cli-style/issues/368)) ([abe4668](https://github.com/dhis2/cli-style/commit/abe466895e561aeeffd4b2c2f07a20eec5c73f72))

# [8.0.0-alpha.2](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.1...v8.0.0-alpha.2) (2020-12-16)

# [8.0.0-alpha.3](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.2...v8.0.0-alpha.3) (2020-12-16)

# [8.0.0-alpha.2](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.1...v8.0.0-alpha.2) (2020-12-16)

### Features

* opt-in git hooks ([#333](https://github.com/dhis2/cli-style/issues/333)) ([a3bc415](https://github.com/dhis2/cli-style/commit/a3bc415d3971756e2ef53ab59dbbc4fb48046b07))

# [8.0.0-alpha.1](https://github.com/dhis2/cli-style/compare/v7.2.3...v8.0.0-alpha.1) (2020-12-16)

### Code Refactoring

* remove husky ([752b944](https://github.com/dhis2/cli-style/commit/752b94409a3a9735d324d05aefdd296f0d6bfb44))

### BREAKING CHANGES

* Husky has been removed from cli-style. You will need to
remove hooks that reference husky.sh in .git/hooks.

# [7.3.0](https://github.com/dhis2/cli-style/compare/v7.2.3...v7.3.0) (2020-12-16)

### Features

* **eslint:** add import order rule ([#334](https://github.com/dhis2/cli-style/issues/334)) ([c7b9991](https://github.com/dhis2/cli-style/commit/c7b99917e39b2ed16165d0a115f0e0c3ebe775e1))

# [8.0.0-alpha.2](https://github.com/dhis2/cli-style/compare/v8.0.0-alpha.1...v8.0.0-alpha.2) (2020-12-16)

### Features

* opt-in git hooks ([#333](https://github.com/dhis2/cli-style/issues/333)) ([a3bc415](https://github.com/dhis2/cli-style/commit/a3bc415d3971756e2ef53ab59dbbc4fb48046b07))

# [8.0.0-alpha.1](https://github.com/dhis2/cli-style/compare/v7.2.3...v8.0.0-alpha.1) (2020-12-16)


### Code Refactoring

* remove husky ([752b944](https://github.com/dhis2/cli-style/commit/752b94409a3a9735d324d05aefdd296f0d6bfb44))


### BREAKING CHANGES

* Husky has been removed from cli-style. You will need to
remove hooks that reference husky.sh in .git/hooks.

## [7.2.3](https://github.com/dhis2/cli-style/compare/v7.2.2...v7.2.3) (2020-12-16)


Expand Down
Empty file modified LICENSE
100644 → 100755
Empty file.
16 changes: 9 additions & 7 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

[![dhis2-cli Compatible](https://img.shields.io/badge/dhis2-cli-ff69b4.svg)](https://github.com/dhis2/cli)
[![@dhis2/cli-style on npm](https://img.shields.io/npm/v/@dhis2/cli-style.svg)](https://www.npmjs.com/package/@dhis2/cli-style)
[![travis.com build](https://img.shields.io/travis/com/dhis2/cli-style.svg)](https://travis-ci.com/dhis2/cli-style)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

Docs are available at [cli-style.dhis2.nu](https://cli-style.dhis2.nu).
Expand All @@ -21,21 +20,24 @@ As a terminal user check out the full CLI. :rocket:
This tool includes the following tools as runtime dependencies, so they
are not necessary to explicitly install:

- [Husky](https://github.com/typicode/husky)
- [Commitlint](https://commitlint.js.org)
- [ESLint](https://eslint.org/)
- [Prettier](https://prettier.io)
- [Husky](https://github.com/typicode/husky)
- [ls-lint](https://ls-lint.org/)

## Usage

```
npx d2-style --help
yarn d2-style --help

yarn d2-style install --help

npx d2-style install --help
yarn d2-style check --help
yarn d2-style check js --help

npx d2-style js --help
npx d2-style js check --help
npx d2-style js apply --help
yarn d2-style apply --help
yarn d2-style apply text --help
```

## Report an issue
Expand Down
Empty file modified config/commitlint.config.js
100644 → 100755
Empty file.
17 changes: 17 additions & 0 deletions config/d2-style.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
hooks: {
'commit-msg': ['yarn d2-style check commit "$1"'],
'pre-commit': ['yarn d2-style check --staged'],
},
tools: {
eslint: ['react'],
prettier: [],
github: ['dependabot', 'semantic-pr', 'stale'],
editorconfig: [],
commitlint: [],
},
patterns: {
js: '**/*.{js,jsx,ts,tsx}',
text: '**/*.{md,json,yml,html}',
},
}
File renamed without changes.
14 changes: 6 additions & 8 deletions config/js/eslint.config.js → config/eslint.config.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const SEVERITY = 2

module.exports = {
extends: [
'eslint:recommended',
Expand All @@ -8,7 +6,8 @@ module.exports = {
'plugin:import/warnings',
],

plugins: ['prettier'],
// unignore implicit rules about what types of files can be linted
ignorePatterns: ['!.*'],

env: {
browser: true,
Expand All @@ -28,22 +27,21 @@ module.exports = {

rules: {
'max-params': [
SEVERITY,
'error',
{
max: 3,
},
],
'prefer-const': [
SEVERITY,
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false,
},
],
'no-mixed-spaces-and-tabs': [SEVERITY],
'prettier/prettier': [SEVERITY],
'no-mixed-spaces-and-tabs': ['error'],
'import/order': [
SEVERITY,
'error',
{
'newlines-between': 'never',
alphabetize: {
Expand Down
14 changes: 0 additions & 14 deletions config/husky-frontend.local.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/husky.config.js

This file was deleted.

8 changes: 0 additions & 8 deletions config/husky.local.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/js/browserslist.config.rc

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions d2-style.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
hooks: {
'commit-msg': ['./bin/d2-style check commit "$1"'],
'pre-commit': ['./bin/d2-style check'],
'pre-push': ['yarn test'],
},
}
Empty file modified docs/_sidebar.md
100644 → 100755
Empty file.
31 changes: 28 additions & 3 deletions docs/faq.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,40 @@

Some wisdom from Go:

> Gofmt's style is no one's favorite, yet gofmt is everyone's favorite.
> `gofmt`'s style is no one's favorite, yet `gofmt` is everyone's favorite.

# I'm getting husky errors

This library depends on husky, which requires node >= 10 and git >= 2.13.0. If you're getting errors like this:
This library as of version 8.0.0 no longer depends on husky, so if you
are getting errors like:

```
Can't find Husky, skipping pre-commit hook
You can reinstall it using 'npm install husky --save-dev' or delete this hook
```

Ensure that your node and git versions satisfy the above requirements. You can check this by running `git --version` and `node --version` from your terminal.
You can remove the husky hooks from `.git/hooks` and opt in to use the
hooks provided here with e.g. `d2-style install git-hooks/all`.

Ensure that your node and git versions satisfy the above requirements.
You can check this by running `git --version` and `node --version` from
your terminal.

# What does an Error and Warnings mean?

`d2-style` is strict by default, as it tries to guard against known lint
from entering the codebase. If the lint is denied early, it is easier,
and faster, to fix it.

We set most our style rules as error to serve this purpose. This works
best when `d2-style` is added to a project that doesn't have a lot of
code yet.

It is also not fun when `d2-style` decides to adopt new rules as errors.
That means by simply updating `d2-style` the codebase can be in need of
significant clean-ups. This is problematic because it can slow adoption
of new versions of the code style, and it can hold back adoption of new
and better code style rules.

To allow for gradual adoption of rules, warnings can be used before
upgrading them to errors.
Loading