Skip to content

Add pylint checking - #87

Merged
Brian Kroth (bpkroth) merged 64 commits into
microsoft:mainfrom
bpkroth:pylint
Sep 19, 2024
Merged

Brian Kroth (bpkroth) merged 64 commits into
microsoft:mainfrom
bpkroth:pylint

Conversation

@bpkroth

@bpkroth Brian Kroth (bpkroth) commented Sep 18, 2024 •

Copy link
Copy Markdown
Contributor

Pull Request

Title

Adds initial pylint checking.


Description

  • Currently disables the requirement for docstrings on functions, methods, modules, classes, etc.
    As discussed with Anna Pavlenko (@apavlen), we can turn those on and add them in a separate PR.

  • Disables a few other more modern syntax suggestions (e.g., more recent type hint style) in order to preserve backwards compatibility for now.

  • Adds specific exceptions in a handful of cases (e.g., too-many-arguments, too-many-instance-attributes, broad-exception-caught, etc.), with FIXME markers for future cleanup.

  • Ignores FIXME markers as downgrading the code style score since we use those to mark improvement opportunities.

  • Adds minor changes to fix the rest of things. Examples include:

    • Remove unused-import
    • Hide _unused_variable (by prefixing with _)
    • Add explicit encoding="utf-8" for opened files.
    • Use %s string encoding for logging
    • Remove use of [] as default params (they can be mutable leading to subtle bugs)
  • Closes Add pylint checks #85


Type of Change

  • ✨ New feature
  • 🔄 Refactor
  • 📝 Documentation update
  • 🧪 Tests

Comment thread pyproject.toml Resolved
@bpkroth Brian Kroth (bpkroth) changed the title WIP: Add pylint checking Add pylint checking Sep 19, 2024
@bpkroth
Brian Kroth (bpkroth) marked this pull request as ready for review September 19, 2024 19:24
@bpkroth
Brian Kroth (bpkroth) requested a review from a team as a code owner September 19, 2024 19:24
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 19, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 71.00000% with 29 lines in your changes missing coverage. Please review.

Project coverage is 76.66%. Comparing base (ac085df) to head (c3f4275).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...cluster_state_provider/FileClusterStateProvider.py 44.44% 8 Missing and 2 partials ⚠️
...sim/simulator/SimulatedBaseClusterStateProvider.py 33.33% 3 Missing and 1 partial ⚠️
...ate_provider/PredictiveFileClusterStateProvider.py 57.14% 3 Missing ⚠️
src/vasim/simulator/ParameterTuning.py 82.35% 3 Missing ⚠️
...simulator/SimulatedInMemoryClusterStateProvider.py 25.00% 3 Missing ⚠️
...im/recommender/forecasting/TimeSeriesForecaster.py 50.00% 1 Missing and 1 partial ⚠️
src/vasim/simulator/analysis/ParetoFrontier.py 33.33% 2 Missing ⚠️
src/vasim/simulator/InMemorySimulator.py 92.85% 1 Missing ⚠️
src/vasim/simulator/analysis/ParetoFront2D.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
- Coverage   76.84%   76.66%   -0.18%     
==========================================
  Files          23       23              
  Lines        1058     1067       +9     
  Branches      132      134       +2     
==========================================
+ Hits          813      818       +5     
- Misses        195      197       +2     
- Partials       50       52       +2     
Flag Coverage Δ
unittests 76.66% <71.00%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread CONTRIBUTING.md Resolved
Comment thread .github/workflows/pythonapp.yml Resolved
**kwargs,
)

# we read updated file every time

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: restore comment

@apavlen Anna Pavlenko (apavlen) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bpkroth
Brian Kroth (bpkroth) enabled auto-merge (squash) September 19, 2024 21:06
@bpkroth
Brian Kroth (bpkroth) merged commit c8358de into microsoft:main Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pylint checks

3 participants