Skip to content

Commit 906e021

Browse files
authored
Merge branch 'main' into james.teddy
2 parents 99bc22c + 8d0209b commit 906e021

File tree

5 files changed

+116
-5
lines changed

5 files changed

+116
-5
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
types: [ready_for_review]
5+
6+
jobs:
7+
test:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, macOS-latest]
12+
python-version: [ '3.8', '3.9', '3.10' ]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
id: setup-python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Python version
24+
run: python -c "import sys; print(sys.version)"
25+
26+
# Install pipenv
27+
- name: Install pipenv
28+
run: python3 -m pip install --upgrade pipenv
29+
30+
# create .venv folder
31+
- name: create .venv folder
32+
run: mkdir -p .venv
33+
34+
# caching dependencies
35+
- name: Caching Dependencies
36+
uses: actions/cache@v2
37+
id: cache-dependencies
38+
with:
39+
path: .venv
40+
key: ${{ matrix.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
41+
42+
# install dependencies
43+
- name: Install dependencies
44+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
45+
run: |
46+
pipenv install --dev --verbose
47+
pipenv install types-requests --dev
48+
# Run bash script
49+
- name: run Bash script
50+
run: pipenv run bash ./.github/check.sh

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ crontab -e
4444
@reboot python -m leeteasy start 14:30 &
4545

4646
```
47-
## Contribution guideline
47+
## Contributing
4848

49-
If you like this project and want to improve by adding features, fixing bugs or anything, please follow
50-
the [contributing guidelines](docs/CONTRIBUTING.md).
49+
We are very happy to see you here. Before sending your pull requests, make sure that you read the whole workflow and the naming conventions mentioned in the [contributing guidelines](docs/CONTRIBUTING.md).
50+
51+
If you have any doubts regarding the contributing guidelines, please feel free to [state it clearly in an issue](https://github.com/sudiptob2/leet-easy/issues/new/choose). All the best!

docs/CONTRIBUTING.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,55 @@
1+
Given below is the general workflow we expect you to follow while making contributions to this project.
2+
3+
4+
### Workflow
5+
1. Go to the issues tab and find an issue you would like to work on.
6+
7+
1.1. Clarify any doubts in the comments section of the issue.
8+
9+
2. Fork the project
10+
11+
3. Create a branch and make small changes on it.
12+
13+
4. Create a **draft PR**
14+
15+
5. Then make other changes and push to the remote branch you created. In this way, the maintainers will be able to provide early reviews and comments for your commits which will save time later on.
16+
17+
18+
6. Once the above steps are done, you can change the PR status from **draft to active**
19+
20+
21+
7. Once the PR is approved, make sure to update and sync your branch
22+
23+
8. Wait for the maintainers to merge your contribution
24+
25+
9. Congratulations! You made your first contribution to Leet Easy
26+
27+
<br>
28+
129
### Fixing a bug, or adding a new feature
230

331
This section generally defines how you can make code contribution. Please follow the below instructions to make code contributions.
432

5-
Code, PR, commit message format, etc convension I follow when I code. Please follow the links below to get details.
33+
Please follow the links given below to see the code, PR, commit message, etc. conventions which we follow.
634

7-
- [Git branch naming convension](BRANCH-NAMING.md)
35+
- [Git branch naming convention](BRANCH-NAMING.md)
836

937
- [Conventional Commits](https://www.conventionalcommits.org/) for commit messages, and [Commit message format](https://gist.github.com/digitaljhelms/3761873) for what to write
1038

1139
- [Linking a PR to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
40+
41+
<br>
42+
43+
### Examples
44+
45+
#### Branch Names: `{branch_type}/{issue-tracker-id-}issue-one-liner`
46+
1. feature/2234-infinite-scroll
47+
2. documentation/3344-linux-installation
48+
3. test/2222-unit-tests
49+
50+
#### Commits
51+
1. [#1234] feature: Submit button added.
52+
2. [#1232] fix: Infinite scroll fixed
53+
3. [#333] test: Add unit tests for xyz feature
54+
55+
Keep contributing. We're eager to see your contributions!

tests/test_validators/__init__.py

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from leeteasy.utils.validatiors import TimeValidator
2+
import datetime
3+
import pytest
4+
5+
class TestTimeValidator:
6+
def test_validator(self):
7+
assert TimeValidator.validate("23:59") == datetime.time(23, 59)
8+
assert TimeValidator.validate("11:59") == datetime.time(11, 59)
9+
assert TimeValidator.validate("0:0") == datetime.time(0, 0)
10+
11+
with pytest.raises(SystemExit):
12+
TimeValidator.validate("2:60")
13+
with pytest.raises(SystemExit):
14+
TimeValidator.validate("24:00")
15+
with pytest.raises(SystemExit):
16+
TimeValidator.validate("5")

0 commit comments

Comments
 (0)