-
Notifications
You must be signed in to change notification settings - Fork 64
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
Pyta Template File Now Resolves Relative To Cwd #1140
Pyta Template File Now Resolves Relative To Cwd #1140
Conversation
…-file-now-resolves-relative-to-cwd
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.
@DanielDervishi nice work, I just left one comment
python_ta/__init__.py
Outdated
@@ -296,7 +299,7 @@ def reset_linter( | |||
( | |||
"pyta-template-file", | |||
{ | |||
"default": "template.html.jinja", | |||
"default": os.path.join(TEMPLATES_DIR, "template.html.jinja"), |
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.
It's not very common to have default values that are dynamically-set (in this case, based on the installation location for PythonTA). A more conventional approach is to use a default value like ''
, and then in the code which uses the value the dynamic TEMPLATES_DIR
location is computed and the default template is used.
Pull Request Test Coverage Report for Build 13221704166Details
💛 - Coveralls |
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.
Nice work, @DanielDervishi!
Proposed Changes
(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)
Problem: The path to the HTML Template file as specified by the argument
pyta-template-file
specified a file relative to the templates directory within the pythonTA project. We'd instead like for thepyta-template-file
argument to specify the HTML template file to be used relative to the current working directory.To achieve this, I changed how the template file path was processed in the HTML reporter to make it accept both relative and absolute paths. I also updated the documentation surrounding the
pyta-tempate-file
to explain that it is the path to the HTML template file. I also changed the default argument value forpyta-template-file
to point to the absolute path of the defaulttemplate.html.jinja
file.Type of Change
(Write an
X
or a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]
into a[x]
in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)