Skip to content
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

feat: Add pre-commit config #1017

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This would also benefit from codespell-project/codespell being added (c.f. https://github.com/scipy-conference/scipy-conference/blob/3755b74eb94a00ca7038b5210f01f021b5127e72/.pre-commit-config.yaml#L30-L38) but given that there are multiple words that need to get added to an ignore list and fixed in files, I've decided to not do that in this PR. as it would need some input from other parties.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ci:
autoupdate_commit_msg: "chore: [pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: >
(?x)^(
.*\.csv
)$
- id: mixed-line-ending
exclude: >
(?x)^(
.*\.csv|
.*\.css
)$
- id: requirements-txt-fixer
- id: trailing-whitespace
exclude: >
(?x)^(
.*\.csv
)$

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.1
hooks:
- id: check-github-workflows
args: ["--verbose"]
matthewfeickert marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion papers/00_bibderwalt/00_bibderwalt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,3 @@ proceedings editors.
:usepackage: somepackage

Some custom LaTeX source here.

1 change: 0 additions & 1 deletion papers/00_texderwalt/00_texderwalt.tex
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,3 @@ \subsection{Important Part \label{important-part}}
\emph{Muddy water, let stand, becomes clear.}
\end{quote}
\end{quotation}

2 changes: 1 addition & 1 deletion papers/00_texderwalt/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ authors:
name: Cleopatra
bibliography: mybib
video: "https://www.youtube.com/watch?v=Hz1JWzyvv8A"
title: A Numerical Perspective to Terraforming a Desert -- latex edition
title: A Numerical Perspective to Terraforming a Desert -- latex edition
4 changes: 2 additions & 2 deletions publisher/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ $(TEXDIR)/%.pdf: $(TEXDIR)/%.tex
title-pdf: $(TEXDIR)/title.pdf
copyright-pdf: $(TEXDIR)/copyright.pdf
organization-pdf: $(TEXDIR)/organization.pdf
students-pdf: $(TEXDIR)/students.pdf
slides-pdf: $(TEXDIR)/slides.pdf
students-pdf: $(TEXDIR)/students.pdf
slides-pdf: $(TEXDIR)/slides.pdf

front-pdf: title-pdf copyright-pdf organization-pdf students-pdf slides-pdf

Expand Down
12 changes: 6 additions & 6 deletions publisher/_static/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ h1, h2, h3, h4, h5 {
line-height: 1.2em;
border-bottom: 2px solid rgb(100,135,220);
border-left: 1px solid rgb(100,135,220);
}
}

h1 {font-size: 1.4em;}
h2 {font-size: 1.25em;}
h3 {font-size: 1.15em;}
Expand Down Expand Up @@ -123,17 +123,17 @@ hr {


/* eye catchers */
.warning
.warning
{
color: red;
}

.error
.error
{
color: red;
}

strong.highlight
strong.highlight
{
background-color: #ffcc99;
padding: 1pt;
Expand All @@ -143,7 +143,7 @@ strong.highlight
/* Recent changes */

div.recentchanges table {
border: 1px solid #e5e5e5;
border: 1px solid #e5e5e5;
}

.recentchanges p {
Expand Down
2 changes: 1 addition & 1 deletion publisher/_static/scipy.sty
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@

% Support for algorithms listings
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{algpseudocode}
23 changes: 11 additions & 12 deletions publisher/_static/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ a {text-decoration: none;
}

.midHeader a {
text-decoration: none;
text-decoration: none;
color: rgb(39,78,144);
margin: 5px 0px 5px 10px;
}
Expand Down Expand Up @@ -114,7 +114,7 @@ a {text-decoration: none;
font-weight: bold;
margin: 0;
padding: 0 0.75ex 0 0.5ex;
}
}

.subHeader a:hover {
text-decoration: underline;
Expand All @@ -132,7 +132,7 @@ a {text-decoration: none;
float: left;
/* background-color: green; for debugging IE surprises*/
width: 212px;
padding: 0;
padding: 0;
overflow: hidden;
display: inline; /* forces IE to calc correct margin */
}
Expand Down Expand Up @@ -161,7 +161,7 @@ a {text-decoration: none;
.sidepanel {
margin: 5px;
float: left;
width: 200px;
width: 200px;
border: 1px solid #9c9c9c;
background: #e5e5e5;
overflow: hidden; /* new 18:11 */
Expand Down Expand Up @@ -316,7 +316,7 @@ pre {
clear: right;
}

/* for broken IE */
/* for broken IE */
* html #pagetrail li {
border-right: 1px solid #AAA;
padding: 0 0.3em 0 0;
Expand Down Expand Up @@ -432,22 +432,22 @@ pre {
margin: 5px 5px;
padding: 0px;
text-align: center;
font-size: 1em;
font-size: 1em;
color: #6C7680;
}

#credits{
margin: 5px 5px;
padding: 0px;
text-align: center;
font-size: 1em;
font-size: 1em;
}

#timings{
margin: 5px 0px;
padding: 0;
text-align: center;
font-size: 0.8em;
font-size: 0.8em;
color: #6C7680;
}
#credits li {
Expand Down Expand Up @@ -554,7 +554,7 @@ TD.tip {
#content .sidebar p {text-align: left;}
#content[dir="rtl"] .sidebar p {text-align: right;}
/* All headings use darker blue and some white space above */
#content .sidebar h3, #content .sidebar h4 {margin: 1.5em 0 0 0;
#content .sidebar h3, #content .sidebar h4 {margin: 1.5em 0 0 0;
padding: 2px 8px; background: #B8C5D9;}
#content .sidebar *:first-child {margin-top: 0}
/* all block elements use light blue background */
Expand All @@ -567,14 +567,13 @@ TD.tip {
#content .sidebar li { display: block;}
#content .sidebar li p {margin: 0; padding: 0; border: none;}

/* Content Figures
/* Content Figures

Default figure float to the end of the page. Left of right classes float to the left or right :-)
*/
#content .figure {float: right; margin: 0 0 0 20px; padding: 0;
#content .figure {float: right; margin: 0 0 0 20px; padding: 0;
font-size: 0.85em;}
#content[dir="rtl"] .figure {float: left; margin: 0 20px 0 0;}
#content .figure.left {float: left; margin: 0 20px 0 0;}
#content .figure.right {float: right; margin: 0 0 0 20px;}
#content .figure p {margin: 0; text-align: center; font-weight: bold;}

2 changes: 1 addition & 1 deletion publisher/_templates/students.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{for student in scipy_scholarship}}
<li>{{html_quote(student['name']) | html}},
<em>{{html_quote(student['org']) | html}}
{{if student.get('location')}},
{{if student.get('location')}},
{{html_quote(student['location']) | html}} {{endif}}</em>
</li>
{{endfor}}
Expand Down
2 changes: 1 addition & 1 deletion publisher/build_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def copy_static_files(dest_fn):
if not os.path.exists(template_fn):
print("Cannot find template.")
sys.exit(-1)

config = get_config()
from_template(dest_fn, config, dest_fn)
copy_static_files(dest_fn)
1 change: 0 additions & 1 deletion publisher/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@
for subdir in glob.glob('%s/*' % dir)
if os.path.isdir(subdir) and not any(e in subdir for e in excludes)])
for dir in (slides_dir, posters_dir, lightning_dir, tools_dir)}

17 changes: 8 additions & 9 deletions publisher/getting_ready_for_new_year.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Getting ready for the new year's proceedings

We're going to assume that you are working in year *x* to set up the proceedings
system for SciPy *x*.
system for SciPy *x*.

This workflow requires a few steps. We will list those steps here, but if you
don't know what some of the words mean, we highly recommend that you read
don't know what some of the words mean, we highly recommend that you read
[the problem section](#What-problem-are-we-solving).

# Workflow
Expand All @@ -22,10 +22,10 @@ All development work should have been occurring on the `dev` branch of the repo.
- `scipy_proceedings/publisher/README.md`
- `scipy_proceedings/publisher/getting_ready_for_new_year.md`

## What problem are we solving?
## What problem are we solving?

For the purposes of this explanation, we're going to describe the workflow in
terms of what needs to be done in the repo in the year `x = 2018`.
terms of what needs to be done in the repo in the year `x = 2018`.

We organise the repo around git branches, specifically we're going to be thinking about 4 branches:

Expand Down Expand Up @@ -55,14 +55,14 @@ the proceedings system. Additionally, this keeps `master` as small as possible.

So, we only want to put the changes to the build system in master. But people
have to submit their proceedings to `2017` in 2017, and `2018` in 2018. How can
we get the improvements to the system without getting the papers?
we get the improvements to the system without getting the papers?

### `dev` is where build changes go

The solution to the previous section problems is the `dev` branch.
The solution to the previous section problems is the `dev` branch.

`dev` specifically exists to house the improvements to the system, without any
of the papers.
of the papers.

That means during the 2018 proceedings any work that is being done to improve
the system should be in PRs made against `dev`, not `2018`.
Expand All @@ -71,7 +71,7 @@ the system should be in PRs made against `dev`, not `2018`.

After merging `dev` into `master`, can branch `2018` off of `master`.

### Merge `dev` into `2018` on an on-going basis.
### Merge `dev` into `2018` on an on-going basis.

But as you are developing the system, you will be making changes to address
specific problems that come up for authors. If we aren't putting any changes in
Expand All @@ -92,4 +92,3 @@ TODO: Figure out workflow to move previous year's branch into its own repo.

Once we write up the workflow, this should be added to the todo list under
[](#Workflow).

2 changes: 1 addition & 1 deletion publisher/mail/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ attrs
google
google-api-python-client
google_auth_oauthlib
pandas
pandas
2 changes: 0 additions & 2 deletions publisher/mail/templates/author-invitation.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ The {{proceedings['title']['acronym']}} {{proceedings['year']}} Proceedings Comm
{{for n in proceedings['editor']}}
{{n}}
{{endfor}}


2 changes: 0 additions & 2 deletions publisher/mail/templates/reviewer-final.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ The {{proceedings['title']['acronym']}} {{proceedings['year']}} Proceedings Comm
{{for n in proceedings['editor']}}
{{n}}
{{endfor}}


2 changes: 1 addition & 1 deletion publisher/mail/templates/reviewer-invitation-2024.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Initial reviews complete 2024-06-21

Final review deadline 2024-07-26

(Authors continue to make revisions in response to final review comments during this period.)
(Authors continue to make revisions in response to final review comments during this period.)

Final author revision deadline 2024-07-31

Expand Down
2 changes: 0 additions & 2 deletions publisher/mail/templates/reviewer-invite.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ The {{proceedings['title']['acronym']}} {{proceedings['year']}} Proceedings Comm
{{for n in proceedings['editor']}}
{{n}}
{{endfor}}


2 changes: 0 additions & 2 deletions publisher/mail/templates/reviewer-reminder.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ The {{proceedings['title']['acronym']}} {{proceedings['year']}} Proceedings Comm
{{for n in proceedings['editor']}}
{{n}}
{{endfor}}


2 changes: 1 addition & 1 deletion publisher/metadata/2010/doi_batch_papers.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion publisher/metadata/2010/doi_batch_slides.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<doi_batch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.4.2" xmlns="http://www.crossref.org/schema/4.4.2" xsi:schemaLocation="http://www.crossref.org/schema/4.4.2 http://www.crossref.org/schemas/crossref4.4.2.xsd"><head><doi_batch_id>Majora.92bf1922-17114a00b36</doi_batch_id><timestamp>1585210565</timestamp><depositor><depositor_name>Dillon Niederhut</depositor_name><email_address>[email protected]</email_address></depositor><registrant>Crossref</registrant></head><body><database><database_metadata language="en"><contributors><person_name contributor_role="editor" sequence="first"><given_name>Dillon</given_name><surname>Niederhut</surname></person_name></contributors><titles><title>Proceedings of the Python in Science Conference</title></titles></database_metadata></database></body></doi_batch>
<doi_batch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.4.2" xmlns="http://www.crossref.org/schema/4.4.2" xsi:schemaLocation="http://www.crossref.org/schema/4.4.2 http://www.crossref.org/schemas/crossref4.4.2.xsd"><head><doi_batch_id>Majora.92bf1922-17114a00b36</doi_batch_id><timestamp>1585210565</timestamp><depositor><depositor_name>Dillon Niederhut</depositor_name><email_address>[email protected]</email_address></depositor><registrant>Crossref</registrant></head><body><database><database_metadata language="en"><contributors><person_name contributor_role="editor" sequence="first"><given_name>Dillon</given_name><surname>Niederhut</surname></person_name></contributors><titles><title>Proceedings of the Python in Science Conference</title></titles></database_metadata></database></body></doi_batch>
2 changes: 1 addition & 1 deletion publisher/metadata/2010/scipy_proc.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,4 @@
"name": "Program Staff"
}
]
}
}
2 changes: 1 addition & 1 deletion publisher/metadata/2010/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -821,4 +821,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion publisher/metadata/2011/doi_batch_papers.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion publisher/metadata/2011/doi_batch_slides.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<doi_batch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.4.2" xmlns="http://www.crossref.org/schema/4.4.2" xsi:schemaLocation="http://www.crossref.org/schema/4.4.2 http://www.crossref.org/schemas/crossref4.4.2.xsd"><head><doi_batch_id>Majora.ebaa42b7-170a862695a</doi_batch_id><timestamp>1583394586</timestamp><depositor><depositor_name>Dillon Niederhut</depositor_name><email_address>[email protected]</email_address></depositor><registrant>Crossref</registrant></head><body><database><database_metadata language="en"><contributors><person_name contributor_role="editor" sequence="first"><given_name>Dillon</given_name><surname>Niederhut</surname></person_name></contributors><titles><title>Proceedings of the Python in Science Conference</title></titles></database_metadata></database></body></doi_batch>
<doi_batch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.4.2" xmlns="http://www.crossref.org/schema/4.4.2" xsi:schemaLocation="http://www.crossref.org/schema/4.4.2 http://www.crossref.org/schemas/crossref4.4.2.xsd"><head><doi_batch_id>Majora.ebaa42b7-170a862695a</doi_batch_id><timestamp>1583394586</timestamp><depositor><depositor_name>Dillon Niederhut</depositor_name><email_address>[email protected]</email_address></depositor><registrant>Crossref</registrant></head><body><database><database_metadata language="en"><contributors><person_name contributor_role="editor" sequence="first"><given_name>Dillon</given_name><surname>Niederhut</surname></person_name></contributors><titles><title>Proceedings of the Python in Science Conference</title></titles></database_metadata></database></body></doi_batch>
2 changes: 1 addition & 1 deletion publisher/metadata/2011/scipy_proc.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,4 @@
"year": "2011",
"editor_email": []
}
}
}
2 changes: 1 addition & 1 deletion publisher/metadata/2011/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -804,4 +804,4 @@
}
}
]
}
}
Loading