Skip to content

Commit 13cb7ff

Browse files
authored
Merge pull request #193 from Farkites/lint-format
Apply eslint, prettier, and black
2 parents 29543d0 + 7f80e48 commit 13cb7ff

File tree

86 files changed

+18606
-22839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+18606
-22839
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["env", "react"]
2+
"presets": ["@babel/preset-env", "@babel/preset-react"]
33
}

.circleci/config.yml

Lines changed: 97 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,141 +1,147 @@
1-
version: 2
1+
version: '2.1'
2+
orbs:
3+
browser-tools: circleci/browser-tools@1.4.6
24

3-
jobs:
4-
"percy-finalize":
5+
executors:
6+
percy-executor:
57
docker:
68
- image: percyio/agent
79
auth:
8-
username: dashautomation
9-
password: $DASH_PAT_DOCKERHUB
10-
steps:
11-
- run: percy finalize --all
12-
"node":
10+
username: dashautomation
11+
password: $DASH_PAT_DOCKERHUB
12+
node-executor:
1313
docker:
14-
- image: circleci/node:8.11.3
14+
- image: cimg/node:20.5.1
1515
auth:
1616
username: dashautomation
1717
password: $DASH_PAT_DOCKERHUB
18-
18+
python-3-11-executor:
19+
docker:
20+
- image: cimg/python:3.11.5-browsers
21+
auth:
22+
username: dashautomation
23+
password: $DASH_PAT_DOCKERHUB
24+
python-3-6-executor:
25+
docker:
26+
- image: cimg/python:3.6.15-browsers
27+
auth:
28+
username: dashautomation
29+
password: $DASH_PAT_DOCKERHUB
30+
31+
jobs:
32+
percy-finalize:
33+
executor: percy-executor
34+
steps:
35+
- run: percy finalize --all
36+
node:
37+
executor: node-executor
1938
steps:
2039
- checkout
21-
22-
- restore_cache:
23-
key: deps1-{{ .Branch }}-{{ checksum "package.json" }}
24-
2540
- run:
26-
name: Install package.json
27-
command: npm i
41+
name: Install package.json
42+
command: npm i
2843

2944
- save_cache:
30-
key: deps1-{{ .Branch }}-{{ checksum "package.json" }}
31-
paths:
32-
- node_modules
45+
key: deps1-{{ .Branch }}-{{ checksum "package.json" }}
46+
paths:
47+
- node_modules
3348

3449
- run:
35-
name: Run eslint
36-
command: ./node_modules/.bin/eslint src
37-
when: always
50+
name: Run eslint
51+
command: npm run lint.eslint
52+
when: always
3853

54+
- run:
55+
name: Run prettier
56+
command: npm run lint.prettier
57+
when: always
58+
59+
python-3-11: &test-template
60+
executor: python-3-11-executor
3961

40-
"python-3.6": &test-template
41-
docker:
42-
- image: circleci/python:3.6-stretch-browsers
43-
auth:
44-
username: dashautomation
45-
password: $DASH_PAT_DOCKERHUB
46-
4762
environment:
4863
PERCY_ENABLED: True
4964
PERCY_PARALLEL_TOTAL: -1
5065

5166
steps:
5267
- checkout
68+
- browser-tools/install-chrome
69+
- browser-tools/install-chromedriver
5370

5471
- restore_cache:
55-
key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }}
72+
key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }}
5673

5774
- run:
58-
name: Create virtualenv
59-
command: |
60-
python3 -m venv venv
75+
name: Create virtualenv
76+
command: rm -rf venv && python -m venv venv
6177

6278
- run:
63-
name: Install requirements
64-
command: |
65-
. venv/bin/activate
66-
pip install -r tests/requirements.txt --quiet
79+
name: Install requirements
80+
command: . venv/bin/activate && pip install -r tests/requirements.txt
6781

6882
- save_cache:
69-
key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }}
70-
paths:
71-
- "venv"
72-
73-
- run:
74-
name: Run pylint
75-
command: |
76-
. venv/bin/activate
77-
pylint usage.py usage-advanced.py usage-elements.py usage-events.py usage-stylesheet.py
78-
pylint demos tests
79-
when: always
83+
key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }}
84+
paths:
85+
- 'venv'
8086

8187
- run:
82-
name: Run flake8
83-
command: |
84-
. venv/bin/activate
85-
flake8 --max-line-length=100 usage.py usage-advanced.py usage-elements.py usage-events.py usage-stylesheet.py
86-
flake8 --max-line-length=100 demos tests
87-
when: always
88+
name: Run lint for Python files
89+
command: |
90+
. venv/bin/activate
91+
npm run lint:python
92+
when: always
8893

8994
- run:
90-
name: Integration Tests - Usage Apps Rendering
91-
command: |
92-
. venv/bin/activate
93-
pytest --nopercyfinalize --headless tests/test_usage.py
94-
when: always
95+
name: Integration Tests - Usage Apps Rendering
96+
command: |
97+
. venv/bin/activate
98+
pytest --nopercyfinalize --headless tests/test_usage.py
99+
when: always
95100

96101
- run:
97-
name: Integration Tests - Interactions
98-
command: |
99-
. venv/bin/activate
100-
pytest --headless tests/test_interactions.py
101-
when: always
102+
name: Integration Tests - Interactions
103+
command: |
104+
. venv/bin/activate
105+
pytest --headless tests/test_interactions.py
106+
when: always
102107

103108
- run:
104-
name: Integration Tests - Callbacks
105-
command: |
106-
. venv/bin/activate
107-
pytest --headless tests/test_callbacks.py
108-
when: always
109+
name: Integration Tests - Callbacks
110+
command: |
111+
. venv/bin/activate
112+
pytest --headless tests/test_callbacks.py
113+
when: always
109114

110115
- run:
111-
name: Capture Percy Snapshots
112-
command: |
113-
. venv/bin/activate
114-
pytest --headless tests/test_percy_snapshot.py
115-
when: always
116+
name: Capture Percy Snapshots
117+
command: |
118+
. venv/bin/activate
119+
pytest --headless tests/test_percy_snapshot.py
120+
when: always
116121

117-
"python-3.7":
122+
python-3-6:
118123
<<: *test-template
119-
docker:
120-
- image: circleci/python:3.7-stretch-browsers
121-
auth:
122-
username: dashautomation
123-
password: $DASH_PAT_DOCKERHUB
124-
124+
executor: python-3-6-executor
125+
125126
environment:
126127
PERCY_ENABLE: False
127128

129+
python-3-11-react-18:
130+
<<: *test-template
131+
executor: python-3-11-executor
132+
133+
environment:
134+
PERCY_ENABLE: False
135+
REACT_VERSION: '18.2.0'
128136

129137
workflows:
130-
version: 2
138+
version: 2.1
131139
build:
132140
jobs:
133-
- "python-3.6":
134-
context: dash-docker-hub
135-
- "python-3.7":
136-
context: dash-docker-hub
137-
- "node":
138-
context: dash-docker-hub
139-
- "percy-finalize":
140-
requires:
141-
- "python-3.6"
141+
- python-3-11
142+
- python-3-6
143+
- python-3-11-react-18
144+
- node
145+
- percy-finalize:
146+
requires:
147+
- python-3-11

.eslintrc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"extends": ["eslint:recommended", "prettier"],
3-
"parser": "babel-eslint",
2+
"extends": ["eslint:recommended", "prettier", "plugin:react/recommended"],
3+
"parser": "@babel/eslint-parser",
44
"parserOptions": {
5+
"requireConfigFile": false,
56
"ecmaVersion": 6,
67
"sourceType": "module",
78
"ecmaFeatures": {
@@ -117,5 +118,10 @@
117118
"ignore": [-1, 0, 1, 2, 3, 100, 10, 0.5]
118119
}],
119120
"no-underscore-dangle": ["off"]
121+
},
122+
"settings": {
123+
"react": {
124+
"version": "detect"
125+
}
120126
}
121127
}

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
extend-ignore = E203, E501

.github/ISSUE_TEMPLATE.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@ it's usually helpful to mention the browser and version that you are using.
1818
#### Description
1919

2020
#### Steps/Code to Reproduce
21+
2122
<!--
2223
Example:
2324
```python
2425
import dash
2526
import dash_cytoscape as cyto
26-
import dash_html_components as html
27+
from dash import html
2728
2829
app = dash.Dash(__name__)
29-
app.scripts.config.serve_locally = True
30-
app.css.config.serve_locally = True
3130
3231
app.layout = html.Div([
3332
cyto.Cytoscape(
@@ -49,25 +48,25 @@ it in the issue: https://gist.github.com
4948
-->
5049

5150
#### Expected Results
51+
5252
<!-- Please paste or describe the expected results.-->
5353

5454
#### Actual Results
55+
5556
<!-- Please paste or specifically describe the actual output or traceback. -->
5657

5758
#### Versions
59+
5860
<!--
5961
Please run the following snippet and paste the output below:
6062
6163
from __future__ import print_function
6264
import dash; print("Dash", dash.__version__)
63-
import dash_html_components; print("Dash Core Components", dash_html_components.__version__)
64-
import dash_core_components; print("Dash HTML Components", dash_core_components.__version__)
6565
import dash_renderer; print("Dash Renderer", dash_renderer.__version)
66-
import dash_cytoscape; print("Dash HTML Components", dash_cytoscape.__version__)
66+
import dash_cytoscape; print("Dash Cytoscape", dash_cytoscape.__version__)
6767
-->
6868

69-
70-
<!--
71-
Thanks for taking the time to help up improve this component. Dash Cytoscape
69+
<!--
70+
Thanks for taking the time to help up improve this component. Dash Cytoscape
7271
would not be possible without awesome contributors like you!
7372
-->

.pylintrc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,6 @@ max-line-length=100
318318
# Maximum number of lines in a module
319319
max-module-lines=1000
320320

321-
# List of optional constructs for which whitespace checking is disabled. `dict-
322-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
323-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
324-
# `empty-line` allows space-only lines.
325-
no-space-check=trailing-comma,
326-
dict-separator
327-
328321
# Allow the body of a class to be on the same line as the declaration if body
329322
# contains single statement.
330323
single-line-class-stmt=no

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.3.1] - 2023-09-27
8+
9+
### Added
10+
* `prettier` and `black` lint/format scripts have been added.
11+
* React 18 job has been added to circleCI workflow.
12+
13+
### Changed
14+
* Dash has been upgraded to 2.* in requirements.txt and tests/requirements.txt.
15+
* Dependencies have been upgraded to lastest versions.
16+
* CircleCI workflow has been updated to version 2.1.
17+
* Python version in CircleCI workflow has been updated to 3.11.
18+
* Node version in CircleCI workflow has been updated to 20.5.1.
19+
20+
### Fixed
21+
* CircleCI workflow has been fixed.
22+
723
## [0.3.0] - 2021-05-19
824

925
### Added

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Dash = "1b08a953-4be3-4667-9a23-3db579824955"
99

1010
[compat]
1111
julia = "1.2"
12-
Dash = "0.1.3"
12+
Dash = "0.1.3, 1.0"

R/cytoCytoscape.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# AUTO GENERATED FILE - DO NOT EDIT
22

3+
#' @export
34
cytoCytoscape <- function(id=NULL, autoRefreshLayout=NULL, autolock=NULL, autoungrabify=NULL, autounselectify=NULL, boxSelectionEnabled=NULL, className=NULL, elements=NULL, generateImage=NULL, imageData=NULL, layout=NULL, maxZoom=NULL, minZoom=NULL, mouseoverEdgeData=NULL, mouseoverNodeData=NULL, pan=NULL, panningEnabled=NULL, responsive=NULL, selectedEdgeData=NULL, selectedNodeData=NULL, style=NULL, stylesheet=NULL, tapEdge=NULL, tapEdgeData=NULL, tapNode=NULL, tapNodeData=NULL, userPanningEnabled=NULL, userZoomingEnabled=NULL, zoom=NULL, zoomingEnabled=NULL) {
45

56
props <- list(id=id, autoRefreshLayout=autoRefreshLayout, autolock=autolock, autoungrabify=autoungrabify, autounselectify=autounselectify, boxSelectionEnabled=boxSelectionEnabled, className=className, elements=elements, generateImage=generateImage, imageData=imageData, layout=layout, maxZoom=maxZoom, minZoom=minZoom, mouseoverEdgeData=mouseoverEdgeData, mouseoverNodeData=mouseoverNodeData, pan=pan, panningEnabled=panningEnabled, responsive=responsive, selectedEdgeData=selectedEdgeData, selectedNodeData=selectedNodeData, style=style, stylesheet=stylesheet, tapEdge=tapEdge, tapEdgeData=tapEdgeData, tapNode=tapNode, tapNodeData=tapNodeData, userPanningEnabled=userPanningEnabled, userZoomingEnabled=userZoomingEnabled, zoom=zoom, zoomingEnabled=zoomingEnabled)

0 commit comments

Comments
 (0)