From 9859d23c164e04da88e1e1267b744da777f2c95f Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 19 Jun 2024 15:51:17 -0400 Subject: [PATCH 01/10] test autofix.ci --- .github/workflows/ci.yml | 8 +++----- memory-viz/src/tests/test_autofix.js | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 memory-viz/src/tests/test_autofix.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ae6b4b4..4db3d1b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,11 +21,9 @@ jobs: run: npm ci - name: Run prettier run: npx prettier . --write - # - name: Commit changes - # uses: stefanzweifel/git-auto-commit-action@v4 - # with: - # commit_message: Apply formatting changes - # branch: ${{ github.head_ref }} + - name: Commit changes + uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc + jest: if: github.event.pull_request.draft == false runs-on: ubuntu-22.04 diff --git a/memory-viz/src/tests/test_autofix.js b/memory-viz/src/tests/test_autofix.js new file mode 100644 index 00000000..626670c3 --- /dev/null +++ b/memory-viz/src/tests/test_autofix.js @@ -0,0 +1 @@ +console.log('If autofix ran correctly, this string should be wrapped in double quotes and there should be a comma and the end of this line. This string should also have proper indentation.') \ No newline at end of file From d6b053b32e52f4df50bbd6d84ad8e8a7f21ba58c Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 19 Jun 2024 16:02:54 -0400 Subject: [PATCH 02/10] add autofix-ci.yml --- .github/workflows/autofix-ci.yml | 25 +++++++++++++++++++++++ .github/workflows/ci.yml | 34 ++++++++++++++++---------------- 2 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/autofix-ci.yml diff --git a/.github/workflows/autofix-ci.yml b/.github/workflows/autofix-ci.yml new file mode 100644 index 00000000..4974f622 --- /dev/null +++ b/.github/workflows/autofix-ci.yml @@ -0,0 +1,25 @@ +name: autofix.ci +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + push: + branches: + - master + +jobs: + autofix: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up node and cache packages + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Install npm packages + run: npm ci + - name: Run prettier + run: npx prettier . --write + - name: Commit changes + uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4db3d1b8..11c274ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,23 +7,23 @@ on: - master jobs: - prettier: - runs-on: ubuntu-22.04 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up node and cache packages - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: npm - - name: Install npm packages - run: npm ci - - name: Run prettier - run: npx prettier . --write - - name: Commit changes - uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc - + # prettier: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout repo + # uses: actions/checkout@v3 + # - name: Set up node and cache packages + # uses: actions/setup-node@v3 + # with: + # node-version: 18 + # cache: npm + # - name: Install npm packages + # run: npm ci + # - name: Run prettier + # run: npx prettier . --write + # - name: Commit changes + # uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc + jest: if: github.event.pull_request.draft == false runs-on: ubuntu-22.04 From 607390f35afade92071dd17bc31d4f32ee8d7d4c Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 19 Jun 2024 16:05:51 -0400 Subject: [PATCH 03/10] add write permissions --- .github/workflows/autofix-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/autofix-ci.yml b/.github/workflows/autofix-ci.yml index 4974f622..a53661ed 100644 --- a/.github/workflows/autofix-ci.yml +++ b/.github/workflows/autofix-ci.yml @@ -5,6 +5,8 @@ on: push: branches: - master +permissions: + contents: write jobs: autofix: From 917bde0fc5d9bba637e2c7defdb962aaf461603d Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 19 Jun 2024 16:11:08 -0400 Subject: [PATCH 04/10] focus prettier on test_autofix only --- .github/workflows/autofix-ci.yml | 2 +- memory-viz/src/tests/test_autofix.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autofix-ci.yml b/.github/workflows/autofix-ci.yml index a53661ed..019a3b84 100644 --- a/.github/workflows/autofix-ci.yml +++ b/.github/workflows/autofix-ci.yml @@ -24,4 +24,4 @@ jobs: - name: Run prettier run: npx prettier . --write - name: Commit changes - uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc \ No newline at end of file + uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc diff --git a/memory-viz/src/tests/test_autofix.js b/memory-viz/src/tests/test_autofix.js index 626670c3..5d71b6eb 100644 --- a/memory-viz/src/tests/test_autofix.js +++ b/memory-viz/src/tests/test_autofix.js @@ -1 +1 @@ -console.log('If autofix ran correctly, this string should be wrapped in double quotes and there should be a comma and the end of this line. This string should also have proper indentation.') \ No newline at end of file +console.log('If autofix ran correctly, this string should be wrapped in double quotes and there should be a comma and the end of this line. This string should also have proper indentation.') From b930b4500534f17045eae96c6d01627ffcba6935 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:12:04 +0000 Subject: [PATCH 05/10] [autofix.ci] apply automated fixes --- memory-viz/src/tests/test_autofix.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memory-viz/src/tests/test_autofix.js b/memory-viz/src/tests/test_autofix.js index 5d71b6eb..2fb78050 100644 --- a/memory-viz/src/tests/test_autofix.js +++ b/memory-viz/src/tests/test_autofix.js @@ -1 +1,3 @@ -console.log('If autofix ran correctly, this string should be wrapped in double quotes and there should be a comma and the end of this line. This string should also have proper indentation.') +console.log( + "If autofix ran correctly, this string should be wrapped in double quotes and there should be a comma and the end of this line. This string should also have proper indentation." +); From 48b934dee42bb8ad430fdd3c6664dadb7d2bdf7e Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 19 Jun 2024 16:25:48 -0400 Subject: [PATCH 06/10] update yml files --- .github/workflows/autofix-ci.yml | 3 +++ .github/workflows/ci.yml | 17 ----------------- memory-viz/src/tests/test_autofix.js | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/autofix-ci.yml b/.github/workflows/autofix-ci.yml index 019a3b84..6cb54665 100644 --- a/.github/workflows/autofix-ci.yml +++ b/.github/workflows/autofix-ci.yml @@ -25,3 +25,6 @@ jobs: run: npx prettier . --write - name: Commit changes uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc + with: + commit_message: Apply formatting changes + branch: ${{ github.head_ref }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11c274ff..bfccc0c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,23 +7,6 @@ on: - master jobs: - # prettier: - # runs-on: ubuntu-22.04 - # steps: - # - name: Checkout repo - # uses: actions/checkout@v3 - # - name: Set up node and cache packages - # uses: actions/setup-node@v3 - # with: - # node-version: 18 - # cache: npm - # - name: Install npm packages - # run: npm ci - # - name: Run prettier - # run: npx prettier . --write - # - name: Commit changes - # uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc - jest: if: github.event.pull_request.draft == false runs-on: ubuntu-22.04 diff --git a/memory-viz/src/tests/test_autofix.js b/memory-viz/src/tests/test_autofix.js index 5d71b6eb..53f971cf 100644 --- a/memory-viz/src/tests/test_autofix.js +++ b/memory-viz/src/tests/test_autofix.js @@ -1 +1 @@ -console.log('If autofix ran correctly, this string should be wrapped in double quotes and there should be a comma and the end of this line. This string should also have proper indentation.') +console.log('If autofix ran correctly, this string should be wrapped in double quotes and there should be a semicolon at the end of this line. This string should also have proper indentation.') From cf7ed78116daa373ad4b070f60fae42e8fb0acb8 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:30:33 +0000 Subject: [PATCH 07/10] [autofix.ci] apply automated fixes --- memory-viz/src/tests/test_autofix.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memory-viz/src/tests/test_autofix.js b/memory-viz/src/tests/test_autofix.js index 53f971cf..e5a76d0d 100644 --- a/memory-viz/src/tests/test_autofix.js +++ b/memory-viz/src/tests/test_autofix.js @@ -1 +1,3 @@ -console.log('If autofix ran correctly, this string should be wrapped in double quotes and there should be a semicolon at the end of this line. This string should also have proper indentation.') +console.log( + "If autofix ran correctly, this string should be wrapped in double quotes and there should be a semicolon at the end of this line. This string should also have proper indentation." +); From c3c99445dff8155635f9b900b4596b5168d7f47e Mon Sep 17 00:00:00 2001 From: Sarah Wang <55766946+sarahsonder@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:37:56 -0400 Subject: [PATCH 08/10] Update autofix-ci.yml --- .github/workflows/autofix-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autofix-ci.yml b/.github/workflows/autofix-ci.yml index 6cb54665..f73ebefc 100644 --- a/.github/workflows/autofix-ci.yml +++ b/.github/workflows/autofix-ci.yml @@ -9,7 +9,7 @@ permissions: contents: write jobs: - autofix: + prettier: runs-on: ubuntu-22.04 steps: - name: Checkout repo From ecc2d090c441dbb4a51e7012bf7a16c0e9e29227 Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Wed, 19 Jun 2024 16:43:17 -0400 Subject: [PATCH 09/10] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26c5eabb..5c29ed9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Removed unused imports in `demo_C.js`. - Added type interfaces and type annotations to `style.ts`. - Added `DrawnEntity` type annotations to source code files. +- Added `autofix.cli` to the CI workflow. ## [0.1.0] - 2024-04-16 From 048bec262356c08e4cb6f08f9375507e34d6d3cd Mon Sep 17 00:00:00 2001 From: Sarah Wang Date: Thu, 20 Jun 2024 11:13:54 -0400 Subject: [PATCH 10/10] incorporate review --- .github/workflows/autofix-ci.yml | 2 +- CHANGELOG.md | 2 +- memory-viz/src/tests/test_autofix.js | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 memory-viz/src/tests/test_autofix.js diff --git a/.github/workflows/autofix-ci.yml b/.github/workflows/autofix-ci.yml index f73ebefc..790fd5fd 100644 --- a/.github/workflows/autofix-ci.yml +++ b/.github/workflows/autofix-ci.yml @@ -6,7 +6,7 @@ on: branches: - master permissions: - contents: write + contents: read jobs: prettier: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c29ed9c..9d803281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Removed unused imports in `demo_C.js`. - Added type interfaces and type annotations to `style.ts`. - Added `DrawnEntity` type annotations to source code files. -- Added `autofix.cli` to the CI workflow. +- Added `autofix.ci` to the CI workflow. ## [0.1.0] - 2024-04-16 diff --git a/memory-viz/src/tests/test_autofix.js b/memory-viz/src/tests/test_autofix.js deleted file mode 100644 index e5a76d0d..00000000 --- a/memory-viz/src/tests/test_autofix.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log( - "If autofix ran correctly, this string should be wrapped in double quotes and there should be a semicolon at the end of this line. This string should also have proper indentation." -);