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

Use ruff as a linter #2031

Merged
merged 4 commits into from
Oct 11, 2023
Merged

Use ruff as a linter #2031

merged 4 commits into from
Oct 11, 2023

Conversation

vshampor
Copy link
Contributor

@vshampor vshampor commented Aug 4, 2023

Changes

Add ruff as a step to the pre-commit pipeline and adjust the codebase to conform.

Reason for changes

Ruff seems to do a good job at basic linting, works much faster than pylint and doesn't even seem to need a virtual environment to function properly. We might want to replace pylint with this entirely to lessen the load on CI.

Related tickets

N/A

Tests

precommit

@vshampor vshampor requested a review from a team as a code owner August 4, 2023 17:59
@github-actions github-actions bot added documentation Improvements or additions to documentation NNCF TF Pull requests that updates NNCF TensorFlow NNCF PT Pull requests that updates NNCF PyTorch NNCF Common Pull request that updates NNCF Common experimental NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF ONNX Pull requests that updates NNCF ONNX NNCF PTQ Pull requests that updates NNCF PTQ labels Aug 4, 2023
@vshampor vshampor added the API Public API-impacting changes label Aug 4, 2023
@vshampor vshampor added API Public API-impacting changes and removed API Public API-impacting changes labels Aug 4, 2023
@vshampor vshampor force-pushed the ruff_fixes branch 2 times, most recently from 6acb790 to 189ac9e Compare August 7, 2023 11:32
@vshampor vshampor removed the API Public API-impacting changes label Aug 7, 2023
@AlexanderDokuchaev
Copy link
Collaborator

Can you add check for copyrights like #1833?
Ruff uses flake8-copyright to it by set copyright in config.

@vshampor vshampor added the API Public API-impacting changes label Aug 18, 2023
@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Merging #2031 (507e98d) into develop (48f8723) will increase coverage by 0.41%.
The diff coverage is 46.69%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2031      +/-   ##
===========================================
+ Coverage    36.11%   36.52%   +0.41%     
===========================================
  Files          479      482       +3     
  Lines        43183    43237      +54     
===========================================
+ Hits         15596    15793     +197     
+ Misses       27587    27444     -143     
Files Coverage Δ
nncf/__init__.py 100.00% <100.00%> (ø)
nncf/common/accuracy_aware_training/__init__.py 100.00% <100.00%> (ø)
nncf/common/graph/__init__.py 100.00% <100.00%> (ø)
nncf/common/graph/graph.py 74.11% <100.00%> (ø)
nncf/common/graph/patterns/__init__.py 100.00% <100.00%> (ø)
nncf/common/insertion_point_graph.py 95.02% <100.00%> (ø)
nncf/common/logging/__init__.py 100.00% <100.00%> (ø)
nncf/common/pruning/operations.py 90.98% <100.00%> (ø)
nncf/common/quantization/config_assignment.py 68.62% <100.00%> (ø)
...mon/quantization/quantizer_propagation/grouping.py 100.00% <100.00%> (ø)
... and 112 more

... and 11 files with indirect coverage changes

@vshampor vshampor force-pushed the ruff_fixes branch 2 times, most recently from a05b2d4 to 5873bdb Compare August 18, 2023 14:22
@vshampor
Copy link
Contributor Author

Can you add check for copyrights like #1833? Ruff uses flake8-copyright to it by set copyright in config.

Done

@vshampor vshampor merged commit 96dde85 into openvinotoolkit:develop Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Public API-impacting changes documentation Improvements or additions to documentation experimental NNCF Common Pull request that updates NNCF Common NNCF ONNX Pull requests that updates NNCF ONNX NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ NNCF TF Pull requests that updates NNCF TensorFlow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants