Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
281 commits
Select commit Hold shift + click to select a range
2b7cad1
Revised POC - Added ternary_expression_analyzer.py
nivethakuruparan Nov 7, 2024
64222ce
Revised POC - Added main.py for analyzer package
nivethakuruparan Nov 7, 2024
6d06200
Revised POC - Added tests folder for src1
nivethakuruparan Nov 7, 2024
92c2754
Revised POC - Ran analyzer.main and created output files
nivethakuruparan Nov 7, 2024
7cc27a6
created detection for long ternary expressions
Sevhena Nov 7, 2024
35556e1
Refactored src folder
Sevhena Nov 7, 2024
583db48
Revised POC - Modifed tests in src1-tests
nivethakuruparan Nov 8, 2024
c8f09f6
Revised POC - Readded base structure for src1
nivethakuruparan Nov 8, 2024
1a87160
Revised POC - Added base_analyzer.py
nivethakuruparan Nov 8, 2024
5c19918
Revised POC - Added pylint_analyzer.py
nivethakuruparan Nov 8, 2024
9db267f
Revised POC - Added ternary_expression_pylint_analyzer.py
nivethakuruparan Nov 8, 2024
dd88936
Revised POC - Added base_energy_meter.py
nivethakuruparan Nov 8, 2024
57f1331
Revised POC - Added codecarbon_energy_meter.py
nivethakuruparan Nov 8, 2024
8ac1d60
Revised POC - Added base_refactorer.py
nivethakuruparan Nov 8, 2024
9792b7d
Revised POC - Added use_a_generator_refactor.py
nivethakuruparan Nov 8, 2024
c1474af
Revised POC - Added analyzers_config.py
nivethakuruparan Nov 8, 2024
e59185f
Revised POC - Added ast_parser.py
nivethakuruparan Nov 8, 2024
62be7c2
Revised POC - Added logger.py
nivethakuruparan Nov 8, 2024
4a487fd
Revised POC - Added outputs_config.py
nivethakuruparan Nov 8, 2024
0ff8dc1
Revised POC - Added refactorer_factory.py
nivethakuruparan Nov 8, 2024
488cb73
Revised POC - Added main.py
nivethakuruparan Nov 8, 2024
73e968e
Revised POC - Added output files
nivethakuruparan Nov 8, 2024
6c69f16
Fixed errors when running code carbon for nivs work
Ayushi1972 Nov 8, 2024
6c94f26
Changed refactoring base class
Nov 9, 2024
61a517c
made restructuring changes
Sevhena Nov 9, 2024
30b741f
Merge branch 'poc' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Nov 9, 2024
58dfa9b
Added long message chain custom analyzer:
Nov 9, 2024
8835302
delete old src folder
Sevhena Nov 9, 2024
b759d4e
added refactoring class for unused imports
Ayushi1972 Nov 9, 2024
13c87d8
Added to test case for unused imports
Ayushi1972 Nov 9, 2024
6352bbe
fixed silly things
Ayushi1972 Nov 9, 2024
db87805
update on output files from last run
Ayushi1972 Nov 9, 2024
bb6aa0b
Merge branch 'poc' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Nov 9, 2024
5817ce5
fixed refactorer
Sevhena Nov 10, 2024
3ac2ae6
#239: Implemented Member Ignoring Method Refactoring
Sevhena Nov 10, 2024
795e526
Added framework for long parameter list refactoring
Nov 10, 2024
d466527
Added refactoring logic for long param list code smell(pending catego…
Nov 10, 2024
6282d2d
Added long param list function example
Nov 10, 2024
4bc6705
Refactorer Code standardarization: refactorer naming, PyLint line num…
Nov 10, 2024
0e9bb17
Added parameter grouping for Long Parameter List refactoring. Updated…
Nov 10, 2024
14169c3
added correct success message to long param list refactor
Sevhena Nov 10, 2024
b04614b
renamed and added refactor for unused variables and class attributes
Ayushi1972 Nov 10, 2024
55b8c4b
fixed silly issues and added to test case
Ayushi1972 Nov 10, 2024
628dc2f
returned test case file to before
Ayushi1972 Nov 10, 2024
5ef01b7
made config changes
Sevhena Nov 10, 2024
8c3c0a3
added test case for unused imports, variables, and class attributes
Ayushi1972 Nov 10, 2024
966f45e
Merge branch 'poc' of https://github.com/ssm-lab/capstone--source-cod…
Ayushi1972 Nov 10, 2024
955aacc
changed deleting to replace with empty line
Ayushi1972 Nov 10, 2024
410388b
Long message chain refactorer done
Nov 11, 2024
9f9f00c
Merge branch 'poc' of https://github.com/Sevhena/capstone--source-cod…
Nov 11, 2024
d70725f
added copy of input test file
Sevhena Nov 11, 2024
9c46dc6
fixed lmc refactorer
Sevhena Nov 11, 2024
deae825
added tests for example 2
Nov 11, 2024
2adabea
Merge branch 'poc' of https://github.com/Sevhena/capstone--source-cod…
Nov 11, 2024
bc78f6c
testing
Nov 11, 2024
4fdcfb3
Changed ending message
nivethakuruparan Nov 11, 2024
96a9654
Added custom pylint smell for unused vars
Ayushi1972 Nov 11, 2024
96b406b
Merge branch 'poc' of https://github.com/ssm-lab/capstone--source-cod…
Ayushi1972 Nov 11, 2024
182b910
fixed test copy for my test cases
Ayushi1972 Nov 11, 2024
7a0d4fd
updated custom smell for unused vars to include unused class attributes
Ayushi1972 Nov 11, 2024
49e1831
fixed small bug for unused attribute refactorer
Ayushi1972 Nov 11, 2024
2c28c44
added functionality testing + implement isolated refactorings
Sevhena Nov 11, 2024
b187e7f
Merge branch 'poc' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Nov 11, 2024
e7515cb
fixed long param list refactor
Sevhena Nov 11, 2024
be289b3
minor fixes for source testing
Sevhena Nov 11, 2024
413884f
made final restructuring changes
Sevhena Nov 11, 2024
3e69236
updated paths and imports
Sevhena Nov 11, 2024
6e6caa1
#249 : Add test for MIM analysis
Sevhena Nov 11, 2024
a598b12
#249 : Add test for LMC analysis
Sevhena Nov 11, 2024
bebeb2a
add analyzer test utility function
Sevhena Nov 11, 2024
45c9464
made typing fixes + changed JSON reporter type
Sevhena Nov 12, 2024
ef032e5
fixed bug in analyzer
Sevhena Nov 12, 2024
66b4932
Merge branch 'dev' into poc
Sevhena Nov 12, 2024
110da51
Merge branch 'dev' into poc
Sevhena Nov 12, 2024
61af376
added testing directories
Sevhena Nov 12, 2024
a6386ee
Merge branch 'dev' into poc
Sevhena Nov 12, 2024
8069814
added placeholder tests to simulate passing
Sevhena Nov 12, 2024
ddd69bb
Merge branch 'poc' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Nov 12, 2024
b1d3476
Merge branch 'dev' into poc
Sevhena Nov 12, 2024
263c7cf
Merge branch 'dev' into poc
Sevhena Nov 12, 2024
1e0e56d
renamed test files for clarity
Sevhena Nov 18, 2024
0175b32
Merge branch 'poc' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Nov 18, 2024
238d594
created ruff pre-commit (#254)
Sevhena Nov 25, 2024
b7c151b
changed pre-commit ruff config to run formatter first (#254)
Sevhena Nov 25, 2024
8b40e96
Merge branch 'dev' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Nov 25, 2024
8c10c8d
Merge branch 'dev' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Nov 25, 2024
0cf7f41
Merge branch 'dev' into poc
Sevhena Nov 25, 2024
6333031
Merge branch 'dev' into poc
Sevhena Nov 25, 2024
c07cdd8
Merge branch 'dev' into poc
Sevhena Nov 25, 2024
0fe2906
Merge branch 'dev' into poc
Sevhena Nov 25, 2024
221b96c
Merge branch 'dev' into poc
Sevhena Nov 25, 2024
cc99cde
add pytest-cov dependency to .toml
Sevhena Nov 25, 2024
12d1d97
Merge branch 'dev' into poc
Sevhena Nov 25, 2024
0f8074a
formatted code according to ruff linter rules
Sevhena Dec 3, 2024
6e8a020
Removed use of StrEnum to support python v3.10+
Sevhena Jan 5, 2025
f836866
Fixed syntax issues related to versioning
Sevhena Jan 5, 2025
322c899
part 1 of long lambda function
Jan 5, 2025
53b841a
formatting
Jan 5, 2025
9da811c
temp fix for test path issue
Sevhena Jan 5, 2025
a7972ff
before tests fix
Jan 5, 2025
4de4e45
Merge branch 'poc' of https://github.com/Sevhena/capstone--source-cod…
Jan 5, 2025
da2192a
Detection for long lambda function done and tested
Jan 5, 2025
cdc4d99
Fixed issue with relative imports
Sevhena Jan 5, 2025
b718f3e
Implement #207: Refactor long element chain for dictionaries using in…
Ayushi1972 Jan 4, 2025
e69e3a7
temp fix for test path issue
Sevhena Jan 5, 2025
76c8475
Fixed issue with relative imports
Sevhena Jan 5, 2025
8cc011f
Fixed some things
Ayushi1972 Jan 7, 2025
2cdb956
fixed up long element chain refactorer and added flattening dictionaries
Ayushi1972 Jan 8, 2025
d3eb20a
Final long element chain refactorer
Ayushi1972 Jan 8, 2025
64ce96f
Added test cases for long element chain refactorer
Ayushi1972 Jan 8, 2025
a77aa9c
added comment
Ayushi1972 Jan 8, 2025
348ddfc
cleaned up unused code
Ayushi1972 Jan 8, 2025
95f00ca
cleaned up some more
Ayushi1972 Jan 8, 2025
d2ec736
Long Lambda Function Done Closes #208
Jan 8, 2025
732a4ab
Long Lambda Function Done Closes #208
Jan 8, 2025
cacfd44
Merge branch 'poc' of https://github.com/Sevhena/capstone--source-cod…
Jan 8, 2025
f813511
Added checker for SCL smell (#286)
Sevhena Jan 9, 2025
e75829d
LongParameterListRefactorer changes
Jan 9, 2025
c233fb4
Fixed SCLR (#286): Added more checks
Sevhena Jan 10, 2025
b43bea4
Updated test input for LPL
Jan 10, 2025
3116ab1
Added some test cases for SCLR (#286)
Sevhena Jan 10, 2025
b508c4e
Added refactorer for SCL smell (#286)
Sevhena Jan 10, 2025
eaefae0
Fixed issue of Assign nodes not checked for last assignment (#286)
Sevhena Jan 10, 2025
181ac3a
Made refactorers' output folder configurable
Sevhena Jan 10, 2025
1cda60d
Created tests for SCL smell (#286)
Sevhena Jan 10, 2025
8701688
Created tests for MIM smell (#239)
Sevhena Jan 10, 2025
113d0ac
Added mock for running tests on sample file
Sevhena Jan 10, 2025
1ee57ca
Added refactor base class method for refactoring validation
Sevhena Jan 10, 2025
fbdb96f
Debugged LongParameterListRefactorer
Jan 11, 2025
d1f5c8d
Added functionality to MIM refactorer (#239)
Sevhena Jan 12, 2025
6d426e8
Updated LongParameterListRefactorer
Jan 13, 2025
832dad4
fixed long message chain bug closes #201
Jan 13, 2025
a377074
Removed self argument for standalone functions in LongParameterListRe…
Jan 13, 2025
92048d4
Added analyzer logic for repeated calls smell (#290)
nivethakuruparan Jan 13, 2025
82618b0
Added refactorer logic for repeated calls smell (#290)
nivethakuruparan Jan 13, 2025
7a74075
Changed back file path (#290)
nivethakuruparan Jan 13, 2025
ae1bf36
Updated LongParameterListRefactorer tests
Jan 13, 2025
3fd19cd
LongParameterList changes
Jan 13, 2025
e806008
Merge branch 'poc-lpl' into poc
Jan 14, 2025
7c0c988
changed long element chain to use base refactoring method for energy
Ayushi1972 Jan 15, 2025
cbb4346
changed to refactor only one dictionary per smell
Ayushi1972 Jan 15, 2025
99fc4e3
fixed test cases for long element chain
Ayushi1972 Jan 15, 2025
067b32d
Removed extra measurements file
nivethakuruparan Jan 15, 2025
1b7a901
Refactored the analyzer class + config files
nivethakuruparan Jan 15, 2025
9c25619
Seperated ast analyzers
nivethakuruparan Jan 15, 2025
a5e9dbf
Made detect_repeated_calls consistent with the others
nivethakuruparan Jan 15, 2025
3508853
Made detect_string_concat_in_loop consistent with the others
nivethakuruparan Jan 15, 2025
05c0ffb
Added a controller class for analyzer
nivethakuruparan Jan 15, 2025
76d9f97
Removed smell severity for smell config
nivethakuruparan Jan 16, 2025
49e5399
Refactored testing module
Sevhena Jan 18, 2025
79cbda7
Add submodule for VS Code PLugin
Jan 21, 2025
2e76a1b
temporary config update for SCO to run VS code plugin
Jan 21, 2025
5408d06
Homogenized the smell object + adjusted SCL checker bug fix
Sevhena Jan 21, 2025
114cc11
Ruff fixes
Jan 21, 2025
97d75c5
Updated Smell type for custom detected repeated calls
Jan 22, 2025
d38455a
Modified SCL refactorer to fix smells with many lines
Sevhena Jan 22, 2025
4d22454
Implement functionality to refactor reassignments SCL
Sevhena Jan 22, 2025
3a16fb1
Replaced print() with I/O streams for plugin communication
Jan 22, 2025
ace2b8b
Merge branch 'smell-refactor' into testing-refactor
Sevhena Jan 22, 2025
b6ca0b1
Re-organized input files
Sevhena Jan 22, 2025
59bfa81
pre-merge commit to prepare for upcoming analyzer changes
Sevhena Jan 22, 2025
a9b9f37
Some smell bug fixes and teststing fixes
Sevhena Jan 23, 2025
943ba88
Added API for plugin communication
Jan 23, 2025
8e37eaa
Updated plugin to call API
Jan 23, 2025
2de57e8
Removed uused files
nivethakuruparan Jan 23, 2025
46dbe7f
Changed smell occurrences back to list + small fixes
Sevhena Jan 23, 2025
07f1f00
Added smells_registry.py
nivethakuruparan Jan 23, 2025
cccd1b0
Added smells_registry helper file
nivethakuruparan Jan 23, 2025
982af7c
Added smells_registry type file
nivethakuruparan Jan 23, 2025
389b6a5
Modified ast functions to include Smell type
nivethakuruparan Jan 23, 2025
f689eb1
Modified the pylint analyzer file
nivethakuruparan Jan 23, 2025
c56149d
Modified the ast analyzer files + controller
nivethakuruparan Jan 23, 2025
693cb7e
Modified the base analyzer file
nivethakuruparan Jan 23, 2025
a776083
Modified main
nivethakuruparan Jan 23, 2025
6ecce9f
Some small formatting fixes
nivethakuruparan Jan 24, 2025
1adfa28
Modified base analyzer
nivethakuruparan Jan 24, 2025
b1b0975
Minor fix if user selects no smells
nivethakuruparan Jan 24, 2025
94ae0a3
Started modifying the refactorer classes
nivethakuruparan Jan 24, 2025
22b1373
Merge branch 'testing-refactor' into new-poc
Sevhena Jan 24, 2025
c861680
complete merge for testing and smell changes into analyzer changes
Sevhena Jan 24, 2025
8e26e84
Merge branch 'plugin' into new-poc
Sevhena Jan 24, 2025
67b9fd0
completed merge with plugin
Sevhena Jan 24, 2025
a7639bd
Set baseline for multi file refactoring (#343)
Sevhena Jan 25, 2025
d918a38
Changed some tests to work with new package structure
Sevhena Jan 25, 2025
ad9e831
Make MIM refactorer compatible with multiple files (#343)
Sevhena Jan 25, 2025
04898af
SCL bug fixes and package reorganization
Sevhena Jan 27, 2025
a64c6de
Added tests for api-main and test runner
Sevhena Jan 27, 2025
4d5715c
adjusted types to match plugin
Sevhena Jan 30, 2025
9e9a370
Fixed CRC and LEC detection
Sevhena Jan 30, 2025
e888278
Fixed smell data issue not being compatible with TS types
Sevhena Jan 30, 2025
e394759
Add fixes to work with refactoring funcitonality in plugin (#353)
Sevhena Feb 3, 2025
8157dd5
Test case for multi file smells for LEC #343
Ayushi1972 Feb 4, 2025
2f44327
Fix for loss of formatting and comments in MIM MVP
Sevhena Feb 5, 2025
acec63a
Merge branch 'new-poc' of https://github.com/ssm-lab/capstone--source…
Sevhena Feb 5, 2025
07a9365
Updated test cases for #343
Ayushi1972 Feb 6, 2025
0fa6498
Refactored LEC Refactorer to handle multiple files and address edge c…
Ayushi1972 Feb 6, 2025
0508c29
Fixed formating for modified files for LEC #343
Ayushi1972 Feb 6, 2025
0af9d0b
Removed unnecessary print statements LEC #343
Ayushi1972 Feb 6, 2025
fb0b6bd
fixed bug ecooptimizer returns nan
Feb 6, 2025
f8f43a7
First mim fix
Sevhena Feb 6, 2025
fd58426
Merge branch 'new-poc' of https://github.com/ssm-lab/capstone--source…
Sevhena Feb 6, 2025
0d46144
LPL Multi File Refactoring Changes #343 (#365)
tanveer-brar Feb 7, 2025
157c6e8
Removed unnecessary import #343
Feb 7, 2025
b652446
Changed threshold for long message chain from 3 to 5
Feb 9, 2025
6509023
Adding logging and filtering to vscode extension (#368)
nivethakuruparan Feb 9, 2025
de1c3e3
car stuff
Feb 9, 2025
4d2952e
Merge branch 'new-poc' of https://github.com/Sevhena/capstone--source…
Feb 9, 2025
1c102a7
formatting
Feb 9, 2025
8fbd399
changes car stuff formatting
Feb 9, 2025
13e8f85
refined response for no energy savings
Sevhena Feb 10, 2025
8a1c4aa
Updated car stuff test(tested)
Feb 10, 2025
842eccc
Fixes edge case affecting the refactoring of diff classes with the sa…
Sevhena Feb 13, 2025
a9dc1ce
create abstract base classs for refactorers affecting multiple files
Sevhena Feb 15, 2025
0e0b6e2
Added directory filtering for multi-file refactoring
Sevhena Feb 15, 2025
c8bf608
fixed bug raised when accessing readonly files
Sevhena Feb 15, 2025
1d6f03f
Changed logging connection to use websockets and updated ouptut location
Sevhena Feb 17, 2025
7145957
Added concrete refactoring directory
Sevhena Feb 17, 2025
08f8afc
fix server shutdown issue stalling
Sevhena Feb 17, 2025
ca11832
refactor: moved some stuff around
Sevhena Feb 18, 2025
d9fd317
fix: enable reconnection to the backend server
Sevhena Feb 18, 2025
a7f5952
Implement endpoint for server health checks
Sevhena Feb 19, 2025
d820c2f
Updated package organization
Sevhena Feb 21, 2025
b062f7c
fixed undeclared instance attributes in LPL refactorer
Sevhena Feb 22, 2025
9310a94
multi file refactoring fixes
Sevhena Feb 24, 2025
48a8914
Added 2/3 passing test cases for lec refactoring module (#395)
Ayushi1972 Feb 24, 2025
d3587b9
Added test cases for lec checker (#397)
Ayushi1972 Feb 24, 2025
75bf8e2
added test cases for refactoring controller (#406)
Ayushi1972 Feb 24, 2025
d5d31b4
Made lec refactorer test cases independent (#395)
Ayushi1972 Feb 26, 2025
2a53135
Create tests for string-concat-in-loop smell + fix bugs
Sevhena Feb 26, 2025
692b268
Create tests for member-ignoring-method smell + bug fixes
Sevhena Feb 27, 2025
66e1350
Changed loggers to be initialized as basic loggers prior to runs
Sevhena Feb 27, 2025
2fb7c54
Fixed test docstrings + added minor test case
Sevhena Feb 27, 2025
eb9c38d
Fixed bug LMC does not diff between calls and attributes. closes #386…
Mar 1, 2025
d084c21
Added checker for long lambda expressions closes #402
Mar 1, 2025
053ddc9
Merge branch 'new-poc' into ayushi/vnvp-lec
Ayushi1972 Mar 1, 2025
fedd91d
#405 Added unit tests for CodeCarbon returns
Mar 2, 2025
de45c96
Added long message chain refactoring tests closes #409
Mar 2, 2025
0b83be4
Merge branch 'new-poc' of https://github.com/Sevhena/capstone--source…
Mar 2, 2025
3526c44
Merge branch 'new-poc' into ayushi/vnvp-lec
Ayushi1972 Mar 2, 2025
7c41cd3
Added long lambda element refactoring tests and fixed some edge cases…
Mar 2, 2025
412353a
fixed up most lec refactorer test cases (#395)
Ayushi1972 Mar 2, 2025
873ab0b
Merge branch 'new-poc' into ayushi/vnvp-lec
Ayushi1972 Mar 2, 2025
1a77889
added coverage configuration
Sevhena Mar 3, 2025
3361c0d
Added unit tests for detect smells api route + fixed bugs
Sevhena Mar 3, 2025
670a225
Added test cases for refactor smells api route + bug fixes
Sevhena Mar 4, 2025
b2f4452
updated plugin submodule path
Sevhena Mar 7, 2025
e1c35c3
updated config
Sevhena Mar 7, 2025
d000136
Merge branch 'dev' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Mar 7, 2025
5533309
structure changes
Sevhena Mar 7, 2025
c3866d3
fixed api detect route test
Sevhena Mar 7, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Run Python Tests"
on:
pull_request:
types: [opened, reopened, synchronize]
branches: [dev]
branches: [dev, dev-workflow-test]
paths:
- "src/ecooptimizer/**/*.py"

Expand Down
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,24 @@ TSWLatexianTemp*

# DRAW.IO files
*.drawio
*.drawio.bkp
*.drawio.bkp

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

.venv/

# Rope
.ropeproject

*.egg-info/

# Package files
outputs/
build/
tests/temp_dir/

# Coverage
.coverage
coverage.*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "plugin/capstone--sco-vs-code-plugin"]
path = plugin/capstone--sco-vs-code-plugin
url = https://github.com/ssm-lab/capstone--sco-vs-code-plugin.git
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.4
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format

Binary file modified docs/projMngmnt/Rev0_Team_Contrib.pdf
Binary file not shown.
File renamed without changes.
1 change: 1 addition & 0 deletions plugin/capstone--sco-vs-code-plugin
139 changes: 139 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "ecooptimizer"
version = "0.0.1"
dependencies = [
"pylint",
"rope",
"astor",
"codecarbon",
"asttokens",
"uvicorn",
"fastapi",
"pydantic",
"libcst",
"websockets",
]
requires-python = ">=3.9"
authors = [
{ name = "Sevhena Walker" },
{ name = "Mya Hussain" },
{ name = "Nivetha Kuruparan" },
{ name = "Ayushi Amin" },
{ name = "Tanveer Brar" },
]

description = "A source code eco optimizer"
readme = "README.md"
license = { file = "LICENSE" }

[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"pytest-mock",
"ruff",
"coverage",
"pyright",
"pre-commit",
]

[project.scripts]
eco-local = "ecooptimizer.__main__:main"
eco-ext = "ecooptimizer.api.__main__:main"
eco-ext-dev = "ecooptimizer.api.__main__:dev"

[project.urls]
Documentation = "https://readthedocs.org"
Repository = "https://github.com/ssm-lab/capstone--source-code-optimizer"
"Bug Tracker" = "https://github.com/ssm-lab/capstone--source-code-optimizer/issues"

[tool.pytest.ini_options]
norecursedirs = ["tests/temp*", "tests/input", "tests/_input_copies"]
addopts = ["--basetemp=tests/temp_dir"]
testpaths = ["tests"]
pythonpath = "src"

[tool.coverage.run]
omit = [
"*/__main__.py",
'*/__init__.py',
'*/utils/*',
"*/test_*.py",
"*/analyzers/*_analyzer.py",
"*/api/app.py",
]

[tool.ruff]
extend-exclude = [
"*tests/input/**/*.py",
"tests/_input_copies",
"tests/temp_dir",
]
line-length = 100

[tool.ruff.lint]
select = [
"E", # Enforce Python Error rules (e.g., syntax errors, exceptions).
"UP", # Check for unnecessary passes and other unnecessary constructs.
"ANN001", # Ensure type annotations are present where needed.
"ANN002",
"ANN003",
"ANN401",
"INP", # Flag invalid Python patterns or usage.
"PTH", # Check path-like or import-related issues.
"F", # Enforce function-level checks (e.g., complexity, arguments).
"B", # Enforce best practices for Python coding (general style rules).
"PT", # Enforce code formatting and Pythonic idioms.
"W", # Enforce warnings (e.g., suspicious constructs or behaviours).
"A", # Flag common anti-patterns or bad practices.
"RUF", # Ruff-specific rules.
"ARG", # Check for function argument issues.,
]

# Avoid enforcing line-length violations (`E501`)
ignore = ["E501", "RUF003"]

# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]

# Ignore `E402` (import violations) in all `__init__.py` files, and in selected subdirectories.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402", "ANN", "INP001"]

[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
mypy-init-return = true

[tool.pyright]
include = ["src", "tests"]
exclude = ["tests/input", "tests/_input*", "tests/temp_dir"]

disableBytesTypePromotions = true
reportAttributeAccessIssue = false
reportPropertyTypeMismatch = true
reportFunctionMemberAccess = true
reportMissingImports = true
reportUnusedVariable = "warning"
reportDuplicateImport = "warning"
reportUntypedFunctionDecorator = true
reportUntypedClassDecorator = true
reportUntypedBaseClass = true
reportUntypedNamedTuple = true
reportPrivateUsage = true
reportConstantRedefinition = "warning"
reportDeprecated = "warning"
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportInconsistentConstructor = true
reportOverlappingOverload = true
reportMissingTypeArgument = true
reportCallInDefaultInitializer = "warning"
reportUnnecessaryIsInstance = "warning"
reportUnnecessaryCast = "warning"
reportUnnecessaryComparison = true
reportMatchNotExhaustive = "warning"
9 changes: 0 additions & 9 deletions src/analyzers/base_analyzer.py

This file was deleted.

70 changes: 0 additions & 70 deletions src/analyzers/pylint_analyzer.py

This file was deleted.

File renamed without changes.
9 changes: 9 additions & 0 deletions src/ecooptimizer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Path of current directory
from pathlib import Path

DIRNAME = Path(__file__).parent

# Entire project directory path
SAMPLE_PROJ_DIR = (DIRNAME / Path("../../tests/input/project_car_stuff")).resolve()
SOURCE = SAMPLE_PROJ_DIR / "main.py"
TEST_FILE = SAMPLE_PROJ_DIR / "test_main.py"
Loading
Loading