Skip to content

Commit 74ffb89

Browse files
Merge branch 'main' into kp-optimize-code-and-add-tests
2 parents 3d68486 + 607f3db commit 74ffb89

11 files changed

+563
-1
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*]
2+
indent_style = space
3+
tab_width = 4
4+
indent_size = 4

.gitignore

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,109 @@
1+
#Emacs backup files
2+
*.*~
3+
4+
# Byte-compiled / optimized / DLL files
15
__pycache__/
6+
*.py[cod]
7+
*$py.class
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
env/
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*,cover
49+
50+
# Flask stuff:
51+
instance/
52+
.webassets-cache
53+
54+
# Scrapy stuff:
55+
.scrapy
56+
57+
# Sphinx documentation
58+
docs/_build/
59+
60+
# PyBuilder
61+
target/
62+
63+
# IPython Notebook
64+
.ipynb_checkpoints
65+
66+
# pyenv
67+
.python-version
68+
69+
# asdf
70+
.tool-versions
71+
72+
# celery beat schedule file
73+
celerybeat-schedule
74+
75+
# dotenv
76+
.env
77+
78+
# virtualenv
79+
.venv/
80+
venv/
81+
ENV/
82+
venv_*/
83+
84+
/ATTIC
85+
/*.iml
86+
.idea
87+
88+
/bin
89+
/include
90+
/pip-selfcheck.json
91+
92+
.DS_Store
93+
/SECRETS
94+
*/**/ATTIC
95+
96+
# IDE configs
97+
.vscode
98+
.nvimrc
99+
.vimrc
100+
101+
/logs/*
102+
mypy.ini
103+
*.DS_Store
104+
105+
# Output Directories
106+
output
107+
result
108+
results
109+
outputs

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
default_language_version:
2+
python: python3
3+
4+
repos:
5+
- repo: https://github.com/astral-sh/ruff-pre-commit
6+
# Ruff version.
7+
rev: v0.3.5
8+
hooks:
9+
# Run the linter.
10+
- id: ruff
11+
args: [ --fix ]
12+
# Run the formatter.
13+
- id: ruff-format

CONTRIBUTION.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Contributing Guidelines
2+
3+
Thank you for considering contributing to our project! We welcome contributions from everyone. To maintain a positive and collaborative environment, please follow these guidelines:
4+
5+
### Creating Issues:
6+
7+
1. **Search Existing Issues**: Before creating a new issue, please search existing issues to see if the topic has already been discussed or reported.
8+
9+
2. **Clear and Descriptive Title**: Provide a clear and descriptive title for your issue, summarizing the problem or enhancement.
10+
11+
3. **Detailed Description**: Provide a detailed description of the issue, including steps to reproduce (if applicable), expected behavior, and actual behavior.
12+
13+
4. **Use Labels**: Use appropriate labels to categorize your issue (e.g., bug, enhancement, documentation, etc.).
14+
15+
### Pull Requests (PRs):
16+
17+
1. **Fork the Repository**: Start by forking the repository to your GitHub account.
18+
19+
2. **Clone the Repository**: Clone the forked repository to your local machine using the `git clone` command.
20+
21+
3. **Create a Branch**: Create a new branch for your contribution. Use descriptive and concise names for your branches. Avoid using special characters and whitespace.
22+
23+
4. **Make Changes**: Make your desired changes to the codebase.
24+
25+
5. **Code Style:** Follow the existing code style and conventions. Ensure proper indentation, variable naming, and commenting.
26+
27+
5. **Test Your Changes**: Ensure that your changes do not break existing functionality. Write test cases to cover your code changes. Ensure that existing tests pass successfully.
28+
29+
6. **Commit Your Changes**: Commit your changes. Write clear and meaningful commit messages. Include a brief summary in the first line followed by a more detailed description if necessary.
30+
31+
7. **Push Changes**: Push your changes to your forked repository.
32+
33+
8. **Submit a Pull Request (PR)**: Once you have pushed your changes, submit a pull request to the main repository. Use a descriptive title for your pull request that summarizes the changes made.
34+
35+
9. **Review Process**: Your PR will be reviewed by project maintainers. Please be patient during the review process and be open to feedback and suggestions.
36+
37+
10. **Merge PR**: If your PR is approved, it will be merged into the main repository. Congratulations on your contribution!
38+
39+
11. **Stay Engaged**: Stay engaged with the community, participate in discussions, and consider contributing further.
40+
41+
Thank you for your interest in contributing to our project! Your contributions help make this project better for everyone.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The goal of this script is to assign exam centers to students.
1818
- आफ्नै विद्यालयमा केन्द्र पार्न नहुने
1919
- दुई विद्यालयका परीक्षार्थीको केन्द्र एक अर्कामा पर्न नहुने, अर्थात् कुनै विद्यालयका परीक्षार्थीको केन्द्र परेको विद्यालयका परीक्षार्थीहरूको केन्द्र अघिल्लो विद्यालयमा पार्न नहुने ।
2020
- एकै स्वामित्व / व्यवस्थापनको भनी पहिचान भएका केन्द्रमा पार्न नहुने
21-
- विगतमा कुनै विद्यालयको कुनै केन्द्रमा पार्दा समस्या देखिएकोमा केन्द्र नदोहोऱ्याउन नहुने
21+
- विगतमा कुनै विद्यालयको कुनै केन्द्रमा पार्दा समस्या देखिएकोमा केन्द्र दोहोऱ्याउन नहुने
2222
- प्रत्येक पटक केन्द्र तोक्ने प्रोग्राम चलाउदा फरक फरक नतिजा आउने गरी ऱ्यान्डमाइज भएको हुनु पर्ने
2323

2424
## Parameters

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
addopts = --cov=. --cov-fail-under 80 --cov-report term --cov-report html --maxfail 1 --force-sugar

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ruff==0.4.1
2+
pytest==8.0.2
3+
pytest-clarity==1.0.1
4+
pytest-sugar==1.0.0
5+
pre-commit==3.6.0
6+
pytest-cov==5.0.0

ruff.toml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Exclude a variety of commonly ignored directories.
2+
exclude = [
3+
".bzr",
4+
".direnv",
5+
".eggs",
6+
".git",
7+
".git-rewrite",
8+
".hg",
9+
".ipynb_checkpoints",
10+
".mypy_cache",
11+
".nox",
12+
".pants.d",
13+
".pyenv",
14+
".pytest_cache",
15+
".pytype",
16+
".ruff_cache",
17+
".svn",
18+
".tox",
19+
".venv",
20+
".vscode",
21+
"__pypackages__",
22+
"_build",
23+
"buck-out",
24+
"build",
25+
"dist",
26+
"site-packages",
27+
"venv",
28+
]
29+
30+
# Same as Black.
31+
line-length = 88
32+
indent-width = 4
33+
34+
# Assume Python 3.8
35+
target-version = "py311"
36+
37+
[lint]
38+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
39+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
40+
# McCabe complexity (`C901`) by default.
41+
select = ["E4", "E7", "E9", "F"]
42+
ignore = []
43+
44+
# Allow fix for all enabled rules (when `--fix`) is provided.
45+
fixable = ["ALL"]
46+
unfixable = []
47+
48+
# Allow unused variables when underscore-prefixed.
49+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
50+
51+
[lint.pycodestyle]
52+
ignore-overlong-task-comments = true
53+
54+
55+
[format]
56+
# Like Black, use double quotes for strings.
57+
quote-style = "double"
58+
59+
# Like Black, indent with spaces, rather than tabs.
60+
indent-style = "space"
61+
62+
# Like Black, respect magic trailing commas.
63+
skip-magic-trailing-comma = false
64+
65+
# Like Black, automatically detect the appropriate line ending.
66+
line-ending = "auto"
67+
68+
# Enable auto-formatting of code examples in docstrings. Markdown,
69+
# reStructuredText code/literal blocks and doctests are all supported.
70+
#
71+
# This is currently disabled by default, but it is planned for this
72+
# to be opt-out in the future.
73+
docstring-code-format = false
74+
75+
# Set the line length limit used when formatting code snippets in
76+
# docstrings.
77+
#
78+
# This only has an effect when the `docstring-code-format` setting is
79+
# enabled.
80+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)