Package: py-concodese
READMEPyConCodeSe is a bug localisation tool:
given a bug report it suggests 10 code files that may contain the bug.For PyConCodeSe to work it needs aTree-sittergrammar
to parse your code (we currently support Java, C#, PHP and Rust) and
thespaCylibrary to parse the bug report and any natural language text in the code.After installing the software as per the following instructions,
you will need to edit a configuration file for each code repo.
The configuration tells PyConCodeSe where your code and your bug reports are.InstallationYou need at least Python 3.8 to run PyConCodeSe and we strongly recommend you install it in avirtual environment.
On Unix (incl. macOS) you would type in a terminal something like:python3.11-mvenvvenvsourcevenv/bin/activateto create and activate a virtual environment in subfoldervenvof your current folder.
Next, typepipinstall-ipy-concodeseto install everything in the current environment and create the main executable scriptpyconcodese.
Finally, set up spaCy withpython-mspacydownloaden_core_web_smNow you can runpyconcodesefrom any folder, as long as you have the virtual environment activated.ConfigurationWhen running PyConCodeSe, if there's no fileconfig.tomlin the current folder,
you're prompted to create one with example values.pyconcodeseThePyConcodeseconfigfile'config.toml'wasnotfoundinthispath.Doyouwanttocopyanexamplefilehere?[y/N]y
Exampleconfig.tomlfilecopiedinthecurrentdirectory.PleasemakesureyouchangethefieldsaccordinglyOpen the configuration file and edit the paths of the various folders:[py-concodese]# the path that contains grammars (e.g. the folder that contains "tree-sitter-c-master")# If you don't have a grammar fplder, Set up an empty folder here and Pyconcodese will download the grammars from Githubgrammar_path="/tmp/Pyconcodese/Grammars"# the next 3 can be the root directory of the application if you wish (e.g.)# the directory that you would like to store the sqlite database(s) insqlite_path="/tmp/Pyconcodese"# the directory that you would like to store the vsm data folders invsm_path="/tmp/Pyconcodese"# where to store output files generated by the applicationoutput_path="/tmp/Pyconcodese"derby_path="/tmp/Pyconcodese/derby"Thegrammar_pathis the folder where the Tree-sitter grammar files will be put.
When runningpyconcodese, you will be asked if you want to update the grammars:
this will automatically download the latest version from GitHub to thegrammar_pathfolder.
You can share the grammar folder between projects, but make sure thegrammar_pathyou select
is an empty folder when running PyConCodeSe for the first time.
The grammar update will fail if the folder already contains files that are not git-versioned
but have the same name as the ones on GitHub.[dataset]bug_repository_file="/tmp/Pyconcodese/bug_repository_file.xml"src_path="/tmp/Pyconcodese"The config.toml file will be created with the current path prefilled as a starting point for all these values.Dataset formatThe dataset (bug reports) that you want to use should be in a particular format. Necessary fields that should be present in the dataset are:issue_id,issue_summary,issue_description,issue_statusandfiles_changed.The following examples show the correct format in which the dataset should be aligned:Json version{"closed_issues":{"1":{"issue_id":"#3085","issue_summary":"Missing PR_SET_PTRACER_ANY","issue_description":"JonathanWoollett-Light…..search=PR_SET_PTRACER_ANY).","issue_status":"Closed","files_changed":[["1","libc-test/semver/fuchsia.txt"],["1","libc-test/semver/linux.txt"],["1","src/fuchsia/mod.rs"],["1","src/unix/linux_like/emscripten/mod.rs"],["1","src/unix/linux_like/linux/mod.rs"]]},"437":{"issue_id":"#100","issue_summary":"Outdated MIPS toolchain","issue_description":"Contributor…..further.","issue_status":"Closed","issue_reporting_time":"","fixed_by":"#114","files_changed":[["1","src/unix/notbsd/linux/mips.rs"],["1","src/unix/notbsd/linux/mod.rs"],["1","src/unix/notbsd/linux/musl.rs"],["1","src/unix/notbsd/linux/other/mod.rs"]]}}}XML version<?xml version="1.0" encoding="ISO-8859-1"?><bugrepositoryname="SWT"><bugid="88829"opendate="2005-03-22 20:41:00"fixdate="2005-04-06 17:05:00"><buginformation><summary>Table.setColumnOrder()maynotfireenoughMoveevents</summary><description>-startwithfivecolumns,alldifferentwidths-doTable.setColumnOrder(newint[]{4,1,2,3,0});-SWT.Moveeventsarefiredforcolumns0and4becausetheyswappedpositions-&amp;gt;butMoveshouldhavebeenfiredforallofthecolumnssincethewidthofthefirstdisplayedcolumnchanged,andthereforealloftheothercolumnsareauto-shiftedaccordingly</description></buginformation><fixedFiles><file>org.eclipse.swt.widgets.Table.java</file></fixedFiles></bug><bugid="90018"opendate="2005-04-01 14:40:00"fixdate="2005-04-05 08:14:00"><buginformation><summary>NativetooltipsleftaroundonCTabFolder</summary><description>HoveroverthePartStackCTabFolderinsideeclipseuntilsomenativetooltipisdisplayed.Forexample,themaximizebutton.Whenthetooltipappears,changeperspectivesusingthekeybinding.theCTabFoldergetshidden,butitstooltipispermanentlydisplayedandnevergoesaway.EvenifthatCTabFolderisdisposed(I'massuming)whentheperspectiveisclosed.</description></buginformation><fixedFiles><file>org.eclipse.swt.custom.CTabFolder.java</file></fixedFiles></bug></bugrepository>