Skip to content

Commit c71d3e4

Browse files
Fix:File Formatting and bug fix in previous PR (#1284)
* Refactor GitHub workflows, documentation, and code style - Updated feature issue template by removing unnecessary newline. - Modified AUR publish workflow to improve permissions and streamline version checking. - Enhanced build-and-release workflow by adjusting environment variable formatting. - Fixed duplicate issue detector workflow by standardizing Python version syntax. - Revised Code of Conduct for improved formatting and clarity. - Improved Manual Setup Guide for better readability and consistency in code blocks. - Cleaned up OpenAPI JSON file by consolidating tags for better organization. - Updated frontend documentation for memories and state management to enhance code clarity. - Added a new line in the index.md file for improved formatting. - Refined extra.css for better styling consistency and responsiveness. ran npx prettier .--write on root folder * Fix:Resolve codrabbit comments --------- Co-authored-by: ROHAN PANDEY <95585299+rohan-pandeyy@users.noreply.github.com>
1 parent 1127dca commit c71d3e4

14 files changed

Lines changed: 329 additions & 524 deletions

File tree

.coderabbit.yaml

Lines changed: 131 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -8,138 +8,138 @@ language: en
88
early_access: true
99

1010
chat:
11-
# CodeRabbit will automatically respond to @coderabbitai mentions in PR comments
12-
auto_reply: true
11+
# CodeRabbit will automatically respond to @coderabbitai mentions in PR comments
12+
auto_reply: true
1313

1414
issue_enrichment:
15-
labeling:
16-
auto_apply_labels: true
17-
labeling_instructions:
18-
- label: bug
19-
instructions: Issues reporting bugs, errors, crashes, incorrect behavior, or unexpected results.
20-
- label: enhancement
21-
instructions: Feature requests, improvements to existing functionality, performance optimizations, refactoring suggestions, UI/UX enhancements.
22-
- label: documentation
23-
instructions: Documentation updates, additions, corrections, or clarifications needed.
24-
planning:
25-
enabled: true
26-
auto_planning:
27-
enabled: true
28-
labels:
29-
- 'plan-me'
30-
- 'feature'
31-
- '!no-plan'
15+
labeling:
16+
auto_apply_labels: true
17+
labeling_instructions:
18+
- label: bug
19+
instructions: Issues reporting bugs, errors, crashes, incorrect behavior, or unexpected results.
20+
- label: enhancement
21+
instructions: Feature requests, improvements to existing functionality, performance optimizations, refactoring suggestions, UI/UX enhancements.
22+
- label: documentation
23+
instructions: Documentation updates, additions, corrections, or clarifications needed.
24+
planning:
25+
enabled: true
26+
auto_planning:
27+
enabled: true
28+
labels:
29+
- "plan-me"
30+
- "feature"
31+
- "!no-plan"
3232

3333
reviews:
34-
profile: chill # Options: chill, assertive
35-
36-
auto_review:
37-
enabled: true
38-
ignore_title_keywords:
39-
- 'WIP'
40-
drafts: false
41-
base_branches:
42-
- develop
43-
44-
high_level_summary: true
45-
sequence_diagrams: true
46-
poem: true
47-
review_status: true
48-
collapse_walkthrough: false
49-
changed_files_summary: true
50-
request_changes_workflow: true
51-
52-
pre_merge_checks:
53-
description:
54-
mode: warning
55-
docstrings:
56-
mode: off
57-
58-
path_filters:
59-
- '!**/node_modules/**'
60-
- '!**/dist/**'
61-
- '!**/build/**'
62-
- '!**/__pycache__/**'
63-
- '!**/.venv/**'
64-
65-
tools:
66-
ruff:
67-
enabled: true
68-
markdownlint:
69-
enabled: true
70-
github-checks:
71-
enabled: true
72-
timeout_ms: 90000
73-
eslint:
74-
enabled: true
75-
biome:
76-
enabled: true
77-
yamllint:
78-
enabled: true
79-
gitleaks:
80-
enabled: true
81-
clippy:
82-
enabled: true
83-
84-
labeling_instructions:
85-
- label: Python
86-
instructions: Apply when the PR/MR contains changes to python source-code
87-
- label: TypeScript/JavaScript
88-
instructions: Apply when the PR/MR contains changes to javascript or typescript source-code
89-
- label: Rust
90-
instructions: Apply when the PR/MR contains changes to Rust source-code (Tauri backend)
91-
- label: Documentation
92-
instructions: Apply whenever project documentation is updated by the PR/MR
93-
- label: Linter
94-
instructions: Apply when the purpose of the PR/MR is related to fixing the feedback from a linter
95-
96-
path_instructions:
97-
# Catch-all general instructions that apply to all files
98-
- path: '**/*'
99-
instructions: |
100-
- Verify that documentation and comments are free of spelling mistakes
101-
- Ensure that test code is automated, comprehensive, and follows testing best practices
102-
- Verify that all critical functionality is covered by tests
103-
- Confirm that the code meets the project's requirements and objectives
104-
- Point out redundant obvious comments that do not add clarity to the code
105-
- Look for code duplication
106-
- Suggest code completions when seeing a TODO or FIXME comment
107-
108-
# TypeScript/JavaScript/React files (Vite Frontend)
109-
- path: '**/*.{ts,tsx,js,jsx}'
110-
instructions: |
111-
TypeScript & React:
112-
- Avoid 'any', use explicit types.
113-
- The code adheres to best practices associated with React and Vite.
114-
- Ensure responsive design principles are followed.
115-
- Check for proper React hook dependencies and prevent unnecessary re-renders.
116-
117-
# Rust files (Tauri Backend)
118-
- path: '**/src-tauri/**/*.rs'
119-
instructions: |
120-
Rust (Tauri):
121-
- Ensure idiomatic Rust code is written.
122-
- Watch out for unnecessary clone() calls or inefficient memory usage.
123-
- Ensure errors are handled properly using Result rather than unwrap() or expect().
124-
- Ensure Tauri commands are safely exposed to the frontend.
125-
126-
# Python files (Backend Microservices)
127-
- path: '**/*.py'
128-
instructions: |
129-
Python:
130-
- Check for PEP 8 violations and Python best practices.
131-
- Check for performance considerations in asynchronous code.
132-
- Ensure proper use of type hints.
133-
134-
# CSS/SCSS files
135-
- path: '**/*.{css,scss}'
136-
instructions: |
137-
CSS & Styling:
138-
- The code adheres to best practices associated with CSS.
139-
- Look for responsive design issues.
140-
141-
# Asset files
142-
- path: '**/assets/**/*'
143-
instructions: |
144-
Assets:
145-
- Check image optimization and proper formats (WebP, SVG).
34+
profile: chill # Options: chill, assertive
35+
36+
auto_review:
37+
enabled: true
38+
ignore_title_keywords:
39+
- "WIP"
40+
drafts: false
41+
base_branches:
42+
- develop
43+
44+
high_level_summary: true
45+
sequence_diagrams: true
46+
poem: true
47+
review_status: true
48+
collapse_walkthrough: false
49+
changed_files_summary: true
50+
request_changes_workflow: true
51+
52+
pre_merge_checks:
53+
description:
54+
mode: warning
55+
docstrings:
56+
mode: off
57+
58+
path_filters:
59+
- "!**/node_modules/**"
60+
- "!**/dist/**"
61+
- "!**/build/**"
62+
- "!**/__pycache__/**"
63+
- "!**/.venv/**"
64+
65+
tools:
66+
ruff:
67+
enabled: true
68+
markdownlint:
69+
enabled: true
70+
github-checks:
71+
enabled: true
72+
timeout_ms: 90000
73+
eslint:
74+
enabled: true
75+
biome:
76+
enabled: true
77+
yamllint:
78+
enabled: true
79+
gitleaks:
80+
enabled: true
81+
clippy:
82+
enabled: true
83+
84+
labeling_instructions:
85+
- label: Python
86+
instructions: Apply when the PR/MR contains changes to python source-code
87+
- label: TypeScript/JavaScript
88+
instructions: Apply when the PR/MR contains changes to javascript or typescript source-code
89+
- label: Rust
90+
instructions: Apply when the PR/MR contains changes to Rust source-code (Tauri backend)
91+
- label: Documentation
92+
instructions: Apply whenever project documentation is updated by the PR/MR
93+
- label: Linter
94+
instructions: Apply when the purpose of the PR/MR is related to fixing the feedback from a linter
95+
96+
path_instructions:
97+
# Catch-all general instructions that apply to all files
98+
- path: "**/*"
99+
instructions: |
100+
- Verify that documentation and comments are free of spelling mistakes
101+
- Ensure that test code is automated, comprehensive, and follows testing best practices
102+
- Verify that all critical functionality is covered by tests
103+
- Confirm that the code meets the project's requirements and objectives
104+
- Point out redundant obvious comments that do not add clarity to the code
105+
- Look for code duplication
106+
- Suggest code completions when seeing a TODO or FIXME comment
107+
108+
# TypeScript/JavaScript/React files (Vite Frontend)
109+
- path: "**/*.{ts,tsx,js,jsx}"
110+
instructions: |
111+
TypeScript & React:
112+
- Avoid 'any', use explicit types.
113+
- The code adheres to best practices associated with React and Vite.
114+
- Ensure responsive design principles are followed.
115+
- Check for proper React hook dependencies and prevent unnecessary re-renders.
116+
117+
# Rust files (Tauri Backend)
118+
- path: "**/src-tauri/**/*.rs"
119+
instructions: |
120+
Rust (Tauri):
121+
- Ensure idiomatic Rust code is written.
122+
- Watch out for unnecessary clone() calls or inefficient memory usage.
123+
- Ensure errors are handled properly using Result rather than unwrap() or expect().
124+
- Ensure Tauri commands are safely exposed to the frontend.
125+
126+
# Python files (Backend Microservices)
127+
- path: "**/*.py"
128+
instructions: |
129+
Python:
130+
- Check for PEP 8 violations and Python best practices.
131+
- Check for performance considerations in asynchronous code.
132+
- Ensure proper use of type hints.
133+
134+
# CSS/SCSS files
135+
- path: "**/*.{css,scss}"
136+
instructions: |
137+
CSS & Styling:
138+
- The code adheres to best practices associated with CSS.
139+
- Look for responsive design issues.
140+
141+
# Asset files
142+
- path: "**/assets/**/*"
143+
instructions: |
144+
Assets:
145+
- Check image optimization and proper formats (WebP, SVG).

.github/.markdownlint-cli2.jsonc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"config": {
33
"MD013": false,
44
"MD024": {
5-
"siblings_only": true
6-
}
5+
"siblings_only": true,
6+
},
77
},
88
"globs": [
99
"**/*.md",
1010
"!**/node_modules/**",
1111
"!**/target/**",
1212
"!**/venv/**",
1313
"!**/.venv/**",
14-
"!LICENSE.md"
15-
]
14+
"!LICENSE.md",
15+
],
1616
}

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ body:
2222
- label: "I agree to follow this project's Code of Conduct"
2323
required: true
2424
- label: "I want to work on this issue"
25-

.github/workflows/aur-publish.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
# schedule:
55
# - cron: '0 0 * * *'
66
workflow_dispatch:
7-
permissions:
7+
8+
permissions:
89
contents: write
910

1011
jobs:
@@ -13,7 +14,6 @@ jobs:
1314
outputs:
1415
need_update: ${{ steps.check_version.outputs.need_update }}
1516
latest_version: ${{ steps.check_version.outputs.latest_version }}
16-
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@v4
@@ -27,42 +27,40 @@ jobs:
2727
id: check_version
2828
run: |
2929
cd publishing
30-
3130
LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/AOSSIE-Org/PictoPy/releases/latest \
32-
| grep -oP '(?<="tag_name": "v)[^"]+')
31+
| grep -oP '(?<="tag_name": ")[^"]+')
3332
echo "Latest version: $LATEST_VERSION"
34-
3533
CURRENT_VERSION=$(grep -oP '(?<=pkgver=)[0-9.]+' PKGBUILD)
3634
echo "Current version: $CURRENT_VERSION"
37-
3835
if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then
3936
echo "need_update=true" >> "$GITHUB_OUTPUT"
4037
else
4138
echo "need_update=false" >> "$GITHUB_OUTPUT"
4239
fi
43-
4440
echo "latest_version=$LATEST_VERSION" >> "$GITHUB_OUTPUT"
4541
4642
- name: Compute sha256 of new deb
4743
if: steps.check_version.outputs.need_update == 'true'
4844
id: sha
4945
run: |
50-
VERSION=${{ steps.check_version.outputs.latest_version }}
51-
DEB_URL="https://github.com/AOSSIE-Org/PictoPy/releases/download/v${VERSION}/PictoPy_${VERSION}_amd64.deb"
46+
VERSION="${{ steps.check_version.outputs.latest_version }}"
47+
DEB_URL="https://github.com/AOSSIE-Org/PictoPy/releases/download/${VERSION}/PictoPy_${VERSION}_amd64.deb"
5248
SHA=$(curl -fsSL "$DEB_URL" | sha256sum | cut -d' ' -f1)
49+
if ! echo "$SHA" | grep -qP '^[a-f0-9]{64}$'; then
50+
echo "ERROR: Invalid SHA256 — deb download may have failed"
51+
exit 1
52+
fi
5353
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
5454
5555
- name: Update PKGBUILD
5656
if: steps.check_version.outputs.need_update == 'true'
5757
run: |
58-
VERSION=${{ steps.check_version.outputs.latest_version }}
59-
SHA=${{ steps.sha.outputs.sha }}
60-
58+
VERSION="${{ steps.check_version.outputs.latest_version }}"
59+
SHA="${{ steps.sha.outputs.sha }}"
6160
cd publishing
6261
sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD
6362
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
6463
sed -i "s/sha256sums=.*/sha256sums=('$SHA')/" PKGBUILD
65-
6664
git add PKGBUILD
6765
git commit -m "upgpkg: pictopy-bin $VERSION"
6866
git push
@@ -80,22 +78,22 @@ jobs:
8078
runs-on: ubuntu-latest
8179
needs: update_version
8280
if: needs.update_version.outputs.need_update == 'true'
83-
8481
steps:
8582
- name: Download artifacts
8683
uses: actions/download-artifact@v4
8784
with:
8885
name: PKGBUILD
86+
path: publishing/
8987

9088
- name: Publish to AUR
9189
uses: KSXGitHub/github-actions-deploy-aur@v4.1.3
9290
with:
9391
pkgname: pictopy-bin
94-
pkgbuild: ./PKGBUILD
92+
pkgbuild: ./publishing/PKGBUILD
9593
commit_username: ${{ secrets.AUR_USERNAME }}
9694
commit_email: ${{ secrets.AUR_EMAIL }}
9795
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
98-
commit_message: v${{ needs.update_version.outputs.latest_version }}
96+
commit_message: ${{ needs.update_version.outputs.latest_version }}
9997
ssh_keyscan_types: rsa,ecdsa,ed25519
10098
updpkgsums: false
10199
allow_empty_commits: false

0 commit comments

Comments
 (0)