Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve format consistency with lint plugins #863

Open
wants to merge 16 commits into
base: release/v4.1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
types: [python]
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: name-tests-test
- id: end-of-file-fixer
types: [python]
- id: requirements-txt-fixer

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
exclude: >-
(?x)^(
.*__init__\.py$
)
args: ["--profile=black"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
args: ["--line-length", "120"]
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [Branch Rules](#branch-rules)
- [Version Control](#version-control)
- [Release Process](#release-process)
- [Roles](#roles)
- [Roles](#roles)
- [Pull Request Process](#pull-request-process)
- [Code Style Guidelines](#code-style-guidelines)
- [Development Setup](#development-setup)
Expand Down Expand Up @@ -169,18 +169,28 @@ gantt

## Code Style Guidelines

- Follow PEP 8 standards for Python code
- Follow PEP 8 standards for Python code using ruff-format
- Do not allow lines over 120 characters unless necessary
- Include docstrings for new functions and classes
- Add comments for complex logic
- Maintain consistent naming conventions
- Security best practices
- Any performance considerations
- Keep all imports at the top of files
- Use ruff or pylint for linting and do not ignore errors or warnings in your changes
- Use `raise` sparingly and never raise base exceptions and errors
- Use pre-commit to make better commits

## Development Setup

1. Clone the repository
2. Install dependencies from requirements.txt
3. Set up necessary API keys and configurations
4. Set up pre-commit

```bash
pre-commit install
```

## Testing

Expand Down
18 changes: 8 additions & 10 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# In this file, you can set the configurations of the app.
import constants

from constants import DEBUG, LLM_MODEL, OPENAI

#config related to logging must have prefix LOG_
LOG_LEVEL = DEBUG
LOG_SELENIUM_LEVEL = DEBUG
# config related to logging must have prefix LOG_
LOG_LEVEL = constants.DEBUG
LOG_SELENIUM_LEVEL = constants.DEBUG
LOG_TO_FILE = True
LOG_TO_CONSOLE = True

Expand All @@ -14,9 +13,8 @@
JOB_SUITABILITY_SCORE = 7

JOB_MAX_APPLICATIONS = 5
JOB_MIN_APPLICATIONS = 1
JOB_MIN_APPLICATIONS = 0

LLM_MODEL_TYPE = 'openai'
LLM_MODEL = 'gpt-4o-mini'
# Only required for OLLAMA models
LLM_API_URL = ''
LLM_MODEL_TYPE = constants.OPENAI
LLM_MODEL = "gpt-4o-mini"
LLM_API_URL = "http://localhost:11434" # Only required for OLLAMA models
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
LLM_API_URL = "llm_api_url"
LLM_MODEL = "llm_model"
OPENAI = "openai"
AIML="aiml"
AIML = "aiml"
CLAUDE = "claude"
OLLAMA = "ollama"
GEMINI = "gemini"
Expand Down
Loading