Skip to content

Conversation

@drgrice1
Copy link
Member

The bin/run-perltidy.pl script is set up the same as the corresponding webwork2 script to autodetect the pg root directory and no longer depends on the PG_ROOT environment variable.

A new perltidyrc file (bin/perltidy-pg.rc) is added. This is used for perl tidying pg code. The only differences are that spaces are used for indentation, and a line limit of 80 characters is used instead of 120.

The WeBWorK::PG::Tidy module is added. This module is a wrapper around the Perl::Tidy module that basically does everything the bin/perltidy-pg.pl script did before. That script now just calls the exported pgtidy method. This module will also be used by the webwork2 PG problem editor to tidy PG problem code.

drgrice1 added a commit to drgrice1/webwork2 that referenced this pull request Jun 30, 2023
This adds a new tab to the PG problem editor (unless editing a course
configuration file).  The tab contains basic information about what it
does, but if the "Tidy Code" button is pressed it perltidies the code in
the CodeMirror editor window.  The tidied code is also saved to the
temprorary file.

The actual tidying is done by a new webwork webservice action (not a
form submission).  If errors occur, they are shown in the renderer
window.

The webwork webwservice depends on a new PG module defined in a
corresponding PG pull request (see openwebwork/pg#868).
The `bin/run-perltidy.pl` script is set up the same as the corresponding
webwork2 script to autodetect the pg root directory and no longer
depends on the PG_ROOT environment variable.

A new perltidyrc file (`bin/perltidy-pg.rc`) is added.  This is used for
perl tidying pg code.  The only differences are that spaces are used for
indentation, and a line limit of 80 characters is used instead of 120.

The `WeBWorK::PG::Tidy` module is added.  This module is a wrapper
around the `Perl::Tidy` module that basically does everything the
`bin/perltidy-pg.pl` script did before.  That script now just calls the
exported `pgtidy` method.  This module will also be used by the webwork2
PG problem editor to tidy PG problem code.
@drgrice1 drgrice1 force-pushed the perltidy-improvements branch from 6c13642 to 651fa85 Compare June 30, 2023 16:31
drgrice1 added a commit to drgrice1/webwork2 that referenced this pull request Jun 30, 2023
This adds a new tab to the PG problem editor (unless editing a course
configuration file).  The tab contains basic information about what it
does, but if the "Tidy Code" button is pressed it perltidies the code in
the CodeMirror editor window.  The tidied code is also saved to the
temprorary file.

The actual tidying is done by a new webwork webservice action (not a
form submission).  If errors occur, they are shown in the renderer
window.

The webwork webwservice depends on a new PG module defined in a
corresponding PG pull request (see openwebwork/pg#868).
drgrice1 added a commit to drgrice1/webwork2 that referenced this pull request Jun 30, 2023
This adds a new tab to the PG problem editor (unless editing a course
configuration file).  The tab contains basic information about what it
does, but if the "Tidy Code" button is pressed it perltidies the code in
the CodeMirror editor window.  The tidied code is also saved to the
temprorary file.

The actual tidying is done by a new webwork webservice action (not a
form submission).  If errors occur, they are shown in the renderer
window.

The webwork webwservice depends on a new PG module defined in a
corresponding PG pull request (see openwebwork/pg#868).
drgrice1 added a commit to drgrice1/webwork2 that referenced this pull request Jun 30, 2023
This adds a new tab to the PG problem editor (unless editing a course
configuration file).  The tab contains basic information about what it
does, but if the "Tidy Code" button is pressed it perltidies the code in
the CodeMirror editor window.  The tidied code is also saved to the
temprorary file.

The actual tidying is done by a new webwork webservice action (not a
form submission).  If errors occur, they are shown in the renderer
window.

The webwork webwservice depends on a new PG module defined in a
corresponding PG pull request (see openwebwork/pg#868).
Copy link
Contributor

@Alex-Jordan Alex-Jordan left a comment

Choose a reason for hiding this comment

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

I just tested by messing up some perl and running the script. And it is working as far as that test went.

drgrice1 added a commit to drgrice1/webwork2 that referenced this pull request Jul 3, 2023
This adds a new tab to the PG problem editor (unless editing a course
configuration file).  The tab contains basic information about what it
does, but if the "Tidy Code" button is pressed it perltidies the code in
the CodeMirror editor window.  The tidied code is also saved to the
temprorary file.

The actual tidying is done by a new webwork webservice action (not a
form submission).  If errors occur, they are shown in the renderer
window.

The webwork webwservice depends on a new PG module defined in a
corresponding PG pull request (see openwebwork/pg#868).
Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

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

Looks good.

@pstaabp pstaabp merged commit 11f12e5 into openwebwork:PG-2.18 Jul 6, 2023
@drgrice1 drgrice1 deleted the perltidy-improvements branch July 6, 2023 11:51
drgrice1 added a commit to openwebwork/webwork2 that referenced this pull request Jul 6, 2023
This adds a new tab to the PG problem editor (unless editing a course
configuration file).  The tab contains basic information about what it
does, but if the "Tidy Code" button is pressed it perltidies the code in
the CodeMirror editor window.  The tidied code is also saved to the
temprorary file.

The actual tidying is done by a new webwork webservice action (not a
form submission).  If errors occur, they are shown in the renderer
window.

The webwork webwservice depends on a new PG module defined in a
corresponding PG pull request (see openwebwork/pg#868).
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.

3 participants