-
-
Notifications
You must be signed in to change notification settings - Fork 32
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 linters #85
Open
LukasMoll
wants to merge
9
commits into
sympy:master
Choose a base branch
from
LukasMoll:add-flake8
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add linters #85
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
66823ee
Added flake8 config
35d8ddc
Applied flake8 code conventions
f87c6e5
Removed sympy specific stuff from flake8 config
9ffc1ff
Added flake8 CI script for github actions
7a61edd
Added ruff config
ddab686
Applied ruff code conventions
95fd96c
Added ruff to github CI
f0e5ef5
removed sympy specific stuff from ruff config
1e93bad
removed unnecessary __init__.py
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[flake8] | ||
doctests = True | ||
ignore = | ||
F403, | ||
select = | ||
C4, | ||
E722, | ||
F, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ------------------------------------------------------------------ # | ||
# # | ||
# SymPy Benchmark CI script for Github Actions # | ||
# # | ||
# Runs each time a pull request is opened, pushed or merged # | ||
# # | ||
# ------------------------------------------------------------------ # | ||
|
||
name: test | ||
on: [push, pull_request] | ||
jobs: | ||
|
||
# -------------------- Code quality ------------------------------ # | ||
|
||
code-quality: | ||
|
||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- run: python -m pip install --upgrade pip | ||
|
||
- run: pip install flake8 ruff | ||
|
||
- name: Run flake8 on the sympy benchmark package | ||
run: flake8 benchmarks slow_benchmarks | ||
|
||
- name: Run Ruff on the sympy benchmark package | ||
run: ruff check . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import sympy | ||
from sympy import symbols, dsolve, Eq, Function, exp | ||
|
||
def _make_ode_01(): | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -96,10 +96,10 @@ class TimeMatrixPower: | |||||||
[ 1/4 + 13*I/4, -825/64 - 147*I/32, 21/8 + I, -537/64 + 143*I/16, -5/8 - 39*I/16, 2473/256 + 137*I/64, -149/64 + 49*I/32, -177/128 - 1369*I/128]]''')) | ||||||||
|
||||||||
def time_Case1(self): | ||||||||
m = self.Case1**4 | ||||||||
_ = self.Case1**4 | ||||||||
|
||||||||
def time_Case2(self): | ||||||||
m = self.Case2**4 | ||||||||
_ = self.Case2**4 | ||||||||
|
||||||||
def time_Case3(self): | ||||||||
m = self.Case3**4 | ||||||||
_ = self.Case3**4 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[tool.ruff] | ||
# Enable Pyflakes `E` and `F` codes by default. | ||
select = [ | ||
"C40", | ||
"E", | ||
"F", | ||
"PIE802", | ||
"PIE810", | ||
"SIM101", | ||
] | ||
|
||
# Ignore rules that currently fail on the SymPy codebase | ||
ignore = [ | ||
"E401", # Multiple imports on one line | ||
"E402", # Module level import not at top of file | ||
"E501", # Line too long (<LENGTH> > 88 characters) | ||
"E701", # Multiple statements on one line (colon) | ||
"E702", # Multiple statements on one line (semicolon) | ||
"E703", # Statement ends with an unnecessary semicolon | ||
"E711", # Comparison to `None` should be `cond is not None` | ||
"E712", # Comparison to `<BOOL>` should be `cond is <BOOL>` | ||
"E713", # Test for membership should be `not in` | ||
"E714", # Test for object identity should be `is not` | ||
"E721", # Do not compare types, use `isinstance()` | ||
"E722", # Do not use bare `except` | ||
"E731", # Do not assign a `lambda` expression, use a `def` | ||
"E741", # Ambiguous variable name: `<VARIABLE>` | ||
"E743", # Ambiguous function name: `<FUNCTION>` | ||
"F401", # `<TYPE>` imported but unused | ||
"F403", # `from <MODULE> import *` used; unable to detect undefined names | ||
"F405", # `<TYPE>` may be undefined, or defined from star imports: `<MODULE>` | ||
"F523", # `.format` call has unused arguments at position(s): <INDEX> | ||
"F601", # Dictionary key literal `'<KEY>'` repeated | ||
"F811", # Redefinition of unused `<VARIABLE>` from line <LINE> | ||
"F821", # Undefined name `VARIABLE` | ||
"F823", # Local variable `VARIABLE` referenced before assignment | ||
"F841", # Local variable `VARIABLE` is assigned to but never used | ||
] | ||
|
||
# Black default, although irrelevant with E501 ignored | ||
line-length = 88 | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe this can be imported from sympy