Skip to content

Commit 68042aa

Browse files
authored
Merge pull request #2 from akarsh1995/dev
v0.2.0
2 parents 62aa0d8 + 8032bda commit 68042aa

Some content is hidden

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

63 files changed

+4945
-893
lines changed

.github/workflows/ci.yml

+103-164
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ '*' ]
5+
branches: ["dev", "master"]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

99
env:
1010
CARGO_TERM_COLOR: always
@@ -15,183 +15,122 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest, macos-latest, windows-latest]
18-
rust: [nightly, stable, '1.70']
18+
rust: [stable, "1.70"]
1919
runs-on: ${{ matrix.os }}
20-
continue-on-error: ${{ matrix.rust == 'nightly' }}
21-
2220
steps:
23-
- uses: actions/checkout@v2
24-
25-
- name: Restore cargo cache
26-
uses: actions/cache@v2
27-
env:
28-
cache-name: ci
29-
with:
30-
path: |
31-
~/.cargo/registry
32-
~/.cargo/git
33-
~/.cargo/bin
34-
target
35-
key: ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
36-
37-
- name: MacOS Workaround
38-
if: matrix.os == 'macos-latest'
39-
run: cargo clean -p serde_derive -p thiserror
40-
41-
- name: Install Rust
42-
uses: actions-rs/toolchain@v1
43-
with:
44-
toolchain: ${{ matrix.rust }}
45-
default: true
46-
override: true
47-
profile: minimal
48-
components: clippy
49-
50-
- name: Build Debug
51-
run: |
52-
cargo build
53-
54-
- name: Run tests
55-
run: cargo test
56-
57-
- name: Run clippy
58-
run: |
59-
cargo clippy --workspace --all-features
60-
61-
- name: Build Release
62-
run: cargo build --release
63-
64-
- name: Test Install
65-
run: cargo install --path "." --force
66-
67-
- name: Binary Size (unix)
68-
if: matrix.os != 'windows-latest'
69-
run: |
70-
ls -l ./target/release/leetui
71-
72-
- name: Binary Size (win)
73-
if: matrix.os == 'windows-latest'
74-
run: |
75-
ls -l ./target/release/leetui.exe
76-
77-
- name: Binary dependencies (mac)
78-
if: matrix.os == 'macos-latest'
79-
run: |
80-
otool -L ./target/release/leetui
81-
82-
- name: Build MSI (windows)
83-
if: matrix.os == 'windows-latest'
84-
run: |
85-
cargo install cargo-wix --version 0.3.3
86-
cargo wix --version
87-
cargo wix -p leetui --no-build --nocapture --output ./target/wix/leetui.msi
88-
ls -l ./target/wix/leetui.msi
89-
90-
build-linux-musl:
91-
runs-on: ubuntu-latest
92-
strategy:
93-
fail-fast: false
94-
matrix:
95-
rust: [nightly, stable, '1.70']
96-
continue-on-error: ${{ matrix.rust == 'nightly' }}
97-
steps:
98-
- uses: actions/checkout@master
99-
- name: Install Rust
100-
uses: actions-rs/toolchain@v1
101-
with:
102-
toolchain: ${{ matrix.rust }}
103-
profile: minimal
104-
default: true
105-
override: true
106-
target: x86_64-unknown-linux-musl
107-
108-
- name: Setup MUSL
109-
run: |
110-
sudo apt-get -qq install musl-tools && sudo apt-get -y install libssl-dev && sudo apt-get -y install pkg-config
111-
- name: Build Debug
112-
run: |
113-
cargo build --target=x86_64-unknown-linux-musl
114-
./target/x86_64-unknown-linux-musl/debug/leetui --version
115-
- name: Build Release
116-
run: |
117-
cargo build --release --target=x86_64-unknown-linux-musl
118-
./target/x86_64-unknown-linux-musl/release/leetui --version
119-
ls -l ./target/x86_64-unknown-linux-musl/release/leetui
120-
- name: Test
121-
run: |
122-
cargo test --workspace --target=x86_64-unknown-linux-musl
123-
- name: Test Install
124-
run: cargo install --path "." --force
21+
- uses: actions/checkout@v3
22+
23+
- name: Restore cargo cache
24+
uses: actions/cache@v3
25+
env:
26+
cache-name: ci
27+
with:
28+
path: |
29+
~/.cargo/registry
30+
~/.cargo/git
31+
~/.cargo/bin
32+
target
33+
key: ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
34+
35+
- name: MacOS Workaround
36+
if: matrix.os == 'macos-latest'
37+
run: cargo clean -p serde_derive -p thiserror
38+
39+
- name: Install Rust
40+
uses: dtolnay/rust-toolchain@stable
41+
with:
42+
toolchain: ${{ matrix.rust }}
43+
default: true
44+
override: true
45+
profile: minimal
46+
components: clippy
47+
48+
- name: Build Debug
49+
run: |
50+
cargo build
51+
52+
- name: Run tests
53+
run: cargo test
54+
55+
- name: Run clippy
56+
run: |
57+
cargo clippy --workspace --all-features
58+
59+
- name: Build Release
60+
run: cargo build --release
61+
62+
- name: Test Install
63+
run: cargo install --path "." --force
64+
65+
- name: Binary Size (unix)
66+
if: matrix.os != 'windows-latest'
67+
run: |
68+
ls -l ./target/release/leetui
69+
70+
- name: Binary Size (win)
71+
if: matrix.os == 'windows-latest'
72+
run: |
73+
ls -l ./target/release/leetui.exe
74+
75+
- name: Binary dependencies (mac)
76+
if: matrix.os == 'macos-latest'
77+
run: |
78+
otool -L ./target/release/leetui
12579
12680
linting:
12781
name: Lints
12882
runs-on: ubuntu-latest
12983
steps:
130-
- uses: actions/checkout@master
131-
- name: Install Rust
132-
uses: actions-rs/toolchain@v1
133-
with:
134-
toolchain: stable
135-
override: true
136-
components: rustfmt
84+
- uses: actions/checkout@master
85+
- name: Install Rust
86+
uses: dtolnay/rust-toolchain@stable
87+
with:
88+
toolchain: stable
89+
override: true
90+
components: rustfmt
13791

138-
- run: cargo fmt -- --check
92+
- run: cargo fmt -- --check
13993

140-
- name: cargo-sort
141-
run: |
142-
cargo install cargo-sort --force
143-
cargo sort -c -w
94+
- name: cargo-sort
95+
run: |
96+
cargo install cargo-sort --force
97+
cargo sort -c -w
14498
145-
- name: cargo-deny install
146-
run: |
147-
cargo install --locked cargo-deny
99+
- name: cargo-deny install
100+
run: |
101+
cargo install --locked cargo-deny
148102
149-
# - name: cargo-deny licenses
150-
# run: |
151-
# cargo deny check licenses
152-
153-
- name: cargo-deny bans
154-
run: |
155-
cargo deny check bans
103+
- name: cargo-deny bans
104+
run: |
105+
cargo deny check bans
156106
157107
udeps:
158108
name: udeps
159109
runs-on: ubuntu-latest
110+
steps:
111+
- uses: actions/checkout@master
112+
- name: Install Rust
113+
uses: dtolnay/rust-toolchain@stable
114+
with:
115+
toolchain: nightly
116+
override: true
117+
118+
- name: cargo-udeps
119+
run: |
120+
cargo install --git https://github.com/est31/cargo-udeps --locked
121+
cargo +nightly udeps --all-targets
122+
123+
log-test:
124+
name: Changelog Test
125+
runs-on: ubuntu-latest
160126
steps:
161127
- uses: actions/checkout@master
162-
- name: Install Rust
163-
uses: actions-rs/toolchain@v1
128+
- name: Extract release notes
129+
id: extract_release_notes
130+
uses: ffurrer2/extract-release-notes@v1
131+
with:
132+
release_notes_file: ./release-notes.txt
133+
- uses: actions/upload-artifact@v1
164134
with:
165-
toolchain: nightly
166-
override: true
167-
168-
- name: cargo-udeps
169-
run: |
170-
# cargo install --locked cargo-udeps
171-
cargo install --git https://github.com/est31/cargo-udeps --locked
172-
cargo +nightly udeps --all-targets
173-
174-
175-
# sec:
176-
# name: Security audit
177-
# runs-on: ubuntu-latest
178-
# steps:
179-
# - uses: actions/checkout@v2
180-
# - uses: actions-rs/audit-check@v1
181-
# with:
182-
# token: ${{ secrets.GITHUB_TOKEN }}
183-
184-
# log-test:
185-
# name: Changelog Test
186-
# runs-on: ubuntu-latest
187-
# steps:
188-
# - uses: actions/checkout@master
189-
# - name: Extract release notes
190-
# id: extract_release_notes
191-
# uses: ffurrer2/extract-release-notes@v1
192-
# with:
193-
# release_notes_file: ./release-notes.txt
194-
# - uses: actions/upload-artifact@v1
195-
# with:
196-
# name: release-notes.txt
197-
# path: ./release-notes.txt
135+
name: release-notes.txt
136+
path: ./release-notes.txt

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
leetcode.sqlite
44
config.toml
55
src/.vscode
6-
src/app_ui/components
7-
src/app_ui/widgets
6+
temp/
7+
gif_demo
8+
.ssh/vhs_ed25519
9+
.ssh/vhs_ed25519.pub

.pre-commit-config.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/doublify/pre-commit-rust
11+
rev: v1.0
12+
hooks:
13+
- id: fmt
14+
- id: cargo-check
15+
- id: clippy

CHANGELOG.md

+30-14
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,46 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7-
- Fix config directories setup for windows
8-
9-
- Take input directly from the user lc session
7+
- Sort questions by:
8+
- likes dislikes ratio.
109

11-
- Sort tags/questions by least accepted.
10+
- Filter
1211

13-
- Sort by likes dislikes ratio.
12+
- Search feature.
1413

15-
- Color question by accepted.
14+
- Scroll bar visible list
1615

17-
- Search feature.
16+
- Take input directly from the user lc session
1817

1918
- Select multiple tags.
2019

21-
- Submit directly.
22-
23-
- Summary of the question
24-
- Submission stats
20+
- Summary of the question
2521
- View more question details
2622

2723
- Invalidate questions cache through `userSessionProgress`
2824

25+
## [0.2.0] - 2023-07-30
26+
27+
### Added
28+
29+
- Read question view is scrollable using up and down keys.
30+
- Question line is colored by easy => green, medium => yellow, hard => red.
31+
- Show helps at the bottom/top.
32+
- Open file in the editor to solve by pressing the key e.
33+
- Create solution file in the preferred language
34+
- Run/test the solution against test cases
35+
- show test case submission stats in the popup
36+
- Submit solution file
37+
- Update table question if solution accepted
38+
- Loading spinner at the top.
39+
- Fix config directories setup for windows
40+
- Submission stats upon successful submit
41+
- Added gif demo using [vhs tape](https://github.com/charmbracelet/vhs)
42+
- Vim like keybinding to jump to a problem (number followed by G (123G) in topic tag "all" questions)
43+
44+
### Fixed
45+
46+
- Failing build windows
2947

3048
## [0.1.0] - 2023-07-19
3149

@@ -45,6 +63,4 @@ All notable changes to this project will be documented in this file.
4563

4664
- Scrollable View of questions corresponding to the tags.
4765

48-
- Read question in the popup using `Enter` key on the selected question.
49-
50-
66+
- Read question in the popup using `Enter` key on the selected question.

0 commit comments

Comments
 (0)