-
Notifications
You must be signed in to change notification settings - Fork 197
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
Add code quality checks to GitHub Actions #1453
base: master
Are you sure you want to change the base?
Add code quality checks to GitHub Actions #1453
Conversation
.github/workflows/causal_lm_cpp.yml
Outdated
- name: Prohibit non-ASCII characters in file names | ||
run: test $(git diff --name-only --diff-filter=A -z $(git hash-object -t tree /dev/null) | LC_ALL=C tr -d '[ -~]\0' | wc -c) == 0 | ||
- name: Check for non-ASCII characters in files (excluding Markdown and hidden files), with characters ± and � allowed | ||
run: ! git grep -n '[^ -~±�]' -- $(git ls-files | grep -vE '^\.' | grep -vE '\.md$' | grep -vE '^(tests/python_tests|tools/who_what_benchmark/(tests|whowhatbench))' | grep -v 'tools/llm_bench/llm_bench_utils/ov_model_classes.py') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to use some existing tools instead of manual commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look for some
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ilya-lavrenov , I've updated the pull request.
The causal_lm_cpp.yml workflow now uses .pre-commit-config.yaml for running pre-commit hooks instead of manual commands. They:
• Remove trailing whitespaces
• Ensure files end with a newline
Additionally, I've added new pre-commit hooks to:
• Validate JSON files for syntax correctness
• Detect merge conflict markers
For non-ASCII character checks, I've introduced custom scripts located in the pre_commit_scripts folder, as I couldn't find suitable existing tools. These scripts are integrated and managed through the same .pre-commit-config.yaml.
Please review the changes and let me know if further adjustments are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with pre-commit
usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Let's wait for @ilya-lavrenov's review. You'll also need to resolve the conflicts.
@Wovchena, thank you for the approval! I'll address the conflicts. |
…ead of manual commands. Configured pre-commit with automated code quality checks and custom scripts for non-ASCII checks.
…-of-file-fixer hook, and to only exclude git-related hidden files from all hooks.
2b33b01
to
5b000a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is automatically generated file. It causes build error.
CMake Error at /home/runner/work/openvino.genai/openvino.genai/src/python/compare_pyi.cmake:25 (message):
File
/home/runner/work/openvino.genai/openvino.genai/src/python/openvino_genai/py_openvino_genai.pyi
is outdated and need to be regenerated with pybind11-stubgen
When GenAI is compiled this file is regenerated. Try installing pybind11-stubgen==2.5.1
and compiling genai. That should modify src/python/openvino_genai/py_openvino_genai.pyi. Push that new file version
…no.genai into add-code-quality-checks
Addresses: Good First Issue #663
Changes made: