Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
311 commits
Select commit Hold shift + click to select a range
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
tanveer-brar Nov 10, 2024
d466527
Added refactoring logic for long param list code smell(pending catego…
tanveer-brar Nov 10, 2024
6282d2d
Added long param list function example
tanveer-brar Nov 10, 2024
4bc6705
Refactorer Code standardarization: refactorer naming, PyLint line num…
tanveer-brar Nov 10, 2024
0e9bb17
Added parameter grouping for Long Parameter List refactoring. Updated…
tanveer-brar 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
tanveer-brar Jan 9, 2025
c233fb4
Fixed SCLR (#286): Added more checks
Sevhena Jan 10, 2025
b43bea4
Updated test input for LPL
tanveer-brar 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
tanveer-brar Jan 11, 2025
d1f5c8d
Added functionality to MIM refactorer (#239)
Sevhena Jan 12, 2025
6d426e8
Updated LongParameterListRefactorer
tanveer-brar Jan 13, 2025
832dad4
fixed long message chain bug closes #201
Jan 13, 2025
a377074
Removed self argument for standalone functions in LongParameterListRe…
tanveer-brar 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
tanveer-brar Jan 13, 2025
3fd19cd
LongParameterList changes
tanveer-brar Jan 13, 2025
e806008
Merge branch 'poc-lpl' into poc
tanveer-brar 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
tanveer-brar Jan 21, 2025
2e76a1b
temporary config update for SCO to run VS code plugin
tanveer-brar Jan 21, 2025
5408d06
Homogenized the smell object + adjusted SCL checker bug fix
Sevhena Jan 21, 2025
114cc11
Ruff fixes
tanveer-brar Jan 21, 2025
97d75c5
Updated Smell type for custom detected repeated calls
tanveer-brar 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
tanveer-brar 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
tanveer-brar Jan 23, 2025
8e37eaa
Updated plugin to call API
tanveer-brar 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
tanveer-brar 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)
tanveer-brar 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
tanveer-brar 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
b37f06f
file restructuring + config update + lint fixes
Sevhena Mar 7, 2025
01a0605
Merge branch 'dev' of https://github.com/ssm-lab/capstone--source-cod…
Sevhena Mar 7, 2025
6a274c9
fixed hardcoded path in api detect route test
Sevhena Mar 7, 2025
e1ea3d9
Moved test lect refactoring to refactorers folder
Ayushi1972 Mar 9, 2025
3fe4ed3
Replace AST with CST for LPL
tanveer-brar Mar 10, 2025
fc3c697
Modified list_comp_any_all.py to use libcst library
nivethakuruparan Mar 10, 2025
22b6d10
Fixed CRC refactorer bug to stop detecting constructor objects as rep…
nivethakuruparan Mar 10, 2025
d478130
Fixed CRC refactorer bug to stop adding cache variable before docstri…
nivethakuruparan Mar 10, 2025
c9e2db8
Fixed CRC analyzer bug to stop detecting classes as repeated calls (#…
nivethakuruparan Mar 10, 2025
8b7fff5
Added test for UGEN Refactorer (#407)
nivethakuruparan Mar 10, 2025
360d6d9
Added test for CRC Refactorer (#411)
nivethakuruparan Mar 10, 2025
bcd77c4
Added test for CRC Analyzer (#404)
nivethakuruparan Mar 10, 2025
11550e0
Unit tests for LPL Refactorer #398
tanveer-brar Mar 10, 2025
015adf2
fixed attribute error in MIM refactorer
Sevhena Mar 10, 2025
f8127af
fixed test structure
Sevhena Mar 10, 2025
9628ef4
Fixed failing tests for CodeCarbon Returns #405
tanveer-brar Mar 10, 2025
149c292
fixed issue where CRC was printing to output_file when overwrite is True
Sevhena Mar 10, 2025
511b4fb
removed UVA smell files
Sevhena Mar 10, 2025
869d233
Merge branch 'new-poc' of https://github.com/ssm-lab/capstone--source…
Sevhena Mar 10, 2025
8d15900
fixed CRC detection test bug
Sevhena Mar 10, 2025
3133bab
removed unused method from LMC refactorer
Sevhena Mar 10, 2025
2c1c7ce
removed utils tests
Sevhena Mar 10, 2025
f48a72f
Added test for Analyzer Controller (#400)
nivethakuruparan Mar 10, 2025
c373512
Added docstring test for CRC refactorer (#411)
nivethakuruparan Mar 10, 2025
4e8410b
Added completed benchmarking closes #458
Mar 10, 2025
624abfc
Added completed benchmarking closes #458
Mar 10, 2025
6bdcaa9
Merge branch 'new-poc' of https://github.com/Sevhena/capstone--source…
Mar 10, 2025
dea22ff
benchmarking fix
Sevhena Mar 10, 2025
2ceb8f5
changed handling of benchmarking artifacts
Sevhena Mar 10, 2025
a1c82e6
updated worflows to only check non-omitted files
Sevhena Mar 14, 2025
521c1ff
ruff lint fixes
Sevhena Mar 14, 2025
fc86721
omit logging route from coverage
Sevhena Mar 14, 2025
4239916
fixed lec multi file refactor test case
Ayushi1972 Mar 16, 2025
ba4e983
addressed blank whitespaces
Ayushi1972 Mar 16, 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
16 changes: 1 addition & 15 deletions .github/workflows/python-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token }}

# Get changed .py files
- name: Get changed .py files
id: changed-py-files
uses: tj-actions/changed-files@v45
with:
files: |
**/*.py
files_ignore: |
tests/input/**/*.py
tests/_input_copies/**/*.py
diff_relative: true # Get the list of files relative to the repo root

- name: Install Python
uses: actions/setup-python@v5
with:
Expand All @@ -49,8 +37,6 @@ jobs:
pip install ruff

- name: Run Ruff
env:
ALL_CHANGED_FILES: ${{ steps.changed-py-files.outputs.all_changed_files }}
run: |
ruff check $ALL_CHANGED_FILES --output-format=github .
ruff check --output-format=github

7 changes: 0 additions & 7 deletions .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,3 @@ jobs:
run: |
git fetch origin ${{ github.base_ref }}
diff-cover coverage.xml --compare-branch=origin/${{ github.base_ref }} --fail-under=80

- name: Check Per-File Coverage
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Checking overall coverage for $file"
coverage report --include=$file --fail-under=80 || exit 1
done
23 changes: 22 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,25 @@ 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/
tests/benchmarking/output/

# 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
141 changes: 141 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
[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",
"*/api/routes/show_logs.py",
]

[tool.ruff]
extend-exclude = [
"*tests/input/**/*.py",
"tests/_input_copies",
"tests/temp_dir",
"tests/benchmarking/test_code/**/*.py",
]
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