Skip to content

Commit

Permalink
RS-234: Add prettier to CI and reformat code (#65)
Browse files Browse the repository at this point in the history
* add prettier and reformat code

* add format checker to pipeline

* update CHANGELOG
  • Loading branch information
atimin authored Apr 29, 2024
1 parent 2ede59f commit 4630c2f
Show file tree
Hide file tree
Showing 62 changed files with 3,517 additions and 2,686 deletions.
30 changes: 4 additions & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-var": "error",
Expand All @@ -21,30 +22,7 @@
"prefer-arrow-callback": "error",
"prefer-destructuring": "error",
"prefer-rest-params": "error",
"space-in-parens": [
"error",
"never"
],
"object-curly-spacing": [
"error",
"never"
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"dot-location": [
"error",
"property"
],
"@typescript-eslint/ban-ts-comment": "off"
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
name: ci
on:
push:
branches: [ main, stable ]
branches: [main, stable]
tags:
- 'v*'
- "v*"
pull_request:
branches: [ main, stable ]
branches: [main, stable]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm i
- run: npm run fmt:check

test:
name: "Install dependencies and test app"
runs-on: ubuntu-latest
needs: format
steps:
- uses: actions/checkout@v2
- name: Install modules
Expand Down
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files

- repo: local
hooks:
- id: fmt
name: fmt
entry: npm
language: system
args:
- run
- fmt

- id: eslint
types_or: [ts, tsx]
name: eslint
entry: npm
language: system
args:
- run
- lint
21 changes: 4 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- RS-180: Show license information in the web console, [PR-64](https://github.com/reductstore/web-console/pull/64)

### Changed:

- RS-234: Add prettier to CI and reformat code, [PR-65](https://github.com/reductstore/web-console/pull/65)

## [1.5.0] - 2024-03-01

### Added:
Expand Down Expand Up @@ -152,37 +156,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial Release

[Unreleased]: https://github.com/reduct-storage/web-console/compare/v1.5.0...HEAD

[1.5.0]: https://github.com/reduct-storage/web-console/compare/v1.5.0...v1.4.1

[1.4.1]: https://github.com/reduct-storage/web-console/compare/v1.4.1...v1.4.0

[1.4.0]: https://github.com/reduct-storage/web-console/compare/v1.3.0...v1.4.0

[1.3.0]: https://github.com/reduct-storage/web-console/compare/v1.2.2...v1.3.0

[1.2.2]: https://github.com/reduct-storage/web-console/compare/v1.2.1...v1.2.2

[1.2.1]: https://github.com/reduct-storage/web-console/compare/v1.2.0...v1.2.1

[1.2.0]: https://github.com/reduct-storage/web-console/compare/v1.1.1...v1.2.0

[1.1.1]: https://github.com/reduct-storage/web-console/compare/v1.1.0...v1.1.1

[1.1.0]: https://github.com/reduct-storage/web-console/compare/v1.0.0...v1.1.0

[1.0.0]: https://github.com/reduct-storage/web-console/compare/v0.5.0...v1.0.0

[0.5.0]: https://github.com/reduct-storage/web-console/compare/v0.4.0...v0.5.0

[0.4.0]: https://github.com/reduct-storage/web-console/compare/v0.3.1...v0.4.0

[0.3.1]: https://github.com/reduct-storage/web-console/compare/v0.3.0...v0.3.1

[0.3.0]: https://github.com/reduct-storage/web-console/compare/v0.2.1...v0.3.0

[0.2.1]: https://github.com/reduct-storage/web-console/compare/v0.2.0...v0.2.1

[0.2.0]: https://github.com/reduct-storage/web-console/compare/v0.1.0...v0.2.0

[0.1.0]: https://github.com/reduct-storage/web-console/releases/tag/v0.1.0
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Respoontnsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@

Web console for [ReductStore](https://www.reduct.store) based on React.js and Ant Design


![Dashboard](readme/dashboard.png)
![Dashboard](readme/dashboard.png)

## Features

* Embedded to ReductStore
* Bucket Management
* Data Browsing
* Token authentication
- Embedded to ReductStore
- Bucket Management
- Data Browsing
- Token authentication

## Demo

You can explore it by using a demo server at [play.reduct.store](https://play.reduct.store).
Expand Down
22 changes: 11 additions & 11 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ module.exports = function override(config, env) {
console.log("override");
const loaders = config.resolve;
loaders.fallback = {
"fs": false,
"tls": false,
"net": false,
"http": false,
"https": false,
"zlib": false,
"path": false,
"stream": require.resolve("stream-browserify"),
"util": false,
"crypto": false,
"buffer": require.resolve("buffer/"),
fs: false,
tls: false,
net: false,
http: false,
https: false,
zlib: false,
path: false,
stream: require.resolve("stream-browserify"),
util: false,
crypto: false,
buffer: require.resolve("buffer/"),
};

return config;
Expand Down
1 change: 0 additions & 1 deletion jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ module.exports = {
moduleNameMapper: {
"\\.(css|less)$": "<rootDir>/src/__mocks__/styleMock.js",
},

};
29 changes: 29 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 @@ -21,8 +21,10 @@
"babel-jest": "^27.5.1",
"buffer": "^6.0.3",
"enzyme": "^3.11.0",
"eslint-config-prettier": "^9.1.0",
"humanize-duration": "^3.30.0",
"jest": "^27.5.1",
"prettier": "^3.2.5",
"prettier-bytes": "^1.0.4",
"react": "^17.0.2",
"react-app-rewired": "^2.2.1",
Expand All @@ -40,7 +42,9 @@
"build": "REACT_APP_VERSION=$npm_package_version react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject",
"lint": "eslint . --ext .ts"
"lint": "eslint . --ext .ts",
"fmt": "prettier --write .",
"fmt:check": "prettier --check ."
},
"proxy": "https://play.reduct.store",
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
27 changes: 13 additions & 14 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,29 @@
}

.Meta {
position: absolute;
bottom: 0;
color: #cccccc;
margin: 20px;

position: absolute;
bottom: 0;
color: #cccccc;
margin: 20px;
}

.MetaItem {
padding: 5px 0;
padding: 5px 0;
}

.Sider {
min-height: 100vh;
background-color: #231b49;
min-height: 100vh;
background-color: #231b49;
}

.MenuItem {
background-color: #231b49;
color: #cccccc;
font-size: larger;
font-weight: bold;
padding: 10px;
background-color: #231b49;
color: #cccccc;
font-size: larger;
font-weight: bold;
padding: 10px;
}

.ant-menu-item-active {
background-color: #cccccc !important;
background-color: #cccccc !important;
}
Loading

0 comments on commit 4630c2f

Please sign in to comment.