Skip to content

Commit b012749

Browse files
authored
Update .pre-commit-config.yaml (#6)
* Update .pre-commit-config.yaml - add google flag! Signed-off-by: Mackenzie Mathis <[email protected]> * Update pyproject.toml - relax single line imports Signed-off-by: Mackenzie Mathis <[email protected]> * Create format.yml - this will check if you really ran your pre-commit ;) if it fails, locally run and `git add .` then git push! Signed-off-by: Mackenzie Mathis <[email protected]> * Create requirements.txt - min. example requirements Signed-off-by: Mackenzie Mathis <[email protected]> * formatting --------- Signed-off-by: Mackenzie Mathis <[email protected]>
1 parent 2570a77 commit b012749

File tree

9 files changed

+59
-27
lines changed

9 files changed

+59
-27
lines changed

.github/workflows/format.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: pre-commit-format
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
pre_commit_checks:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
ref: ${{ github.head_ref }}
17+
18+
- uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.10'
21+
22+
- run: pip install -r requirements.txt
23+
- run: pip install pre-commit
24+
- run: pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ repos:
1111
rev: 5.12.0
1212
hooks:
1313
- id: isort
14+
args: ["--profile", "google"]
1415
- repo: https://github.com/psf/black
1516
rev: 22.3.0
1617
hooks:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ project_name/
5757

5858
* Formatted code makes your life and those who use/review your code easier. Standardized formatting with tools like `black` and `isort` (see the provided `.pre-commit-config.yaml`).
5959
* [Pre-commit hooks](https://pre-commit.com/) to automate checks before pushing code! Follow their quick Guide to do this, but in short:
60-
60+
6161
(1) install it in your dev env
6262
```python
6363
pip install pre-commit
@@ -85,12 +85,12 @@ project_name/
8585

8686
* [DataJoint](https://www.datajoint.com/) examples for managing and querying scientific data pipelines - these are a must; use minimally for data + meta data storage, and use it to automate things you do daily (preprocessing, running DeepLabCut, etc!)
8787
* [Templates for common workflows and schema management are here!](https://docs.datajoint.com/elements/)
88-
88+
8989

9090
7. **Style Guide for overall code & project management**
9191

9292
* Tips and practices for code, manuscripts, and figures.
93-
93+
9494

9595
---
9696

_toc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ parts:
77
- file: docs/DEV_GUIDE
88
- file: docs/Learning_resources
99
- file: docs/HowTo_JupyterBook
10-

docs/DEV_GUIDE.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1. **Be Constructive and Respectful**
1414
- Focus on the code, not the person 🔐
1515
- Provide clear, actionable feedback 🚧
16-
- Explain the "why" behind your suggestions
16+
- Explain the "why" behind your suggestions
1717
- Use a positive and encouraging tone 💜
1818

1919
2. **Review Checklist**
@@ -96,7 +96,7 @@
9696

9797
## Collaborative Coding Guidelines
9898

99-
Each project is different, so please check project-specific guidelines.
99+
Each project is different, so please check project-specific guidelines.
100100
However, below is a guide for collaborative projects in general.
101101
I recommend the following system for within-lab projects that have different levels of maintainers & builders.
102102

@@ -108,7 +108,7 @@ I recommend the following system for within-lab projects that have different lev
108108
- No one person is the gate-keeper for the project: work together
109109
2. **Get a review assignment system in place**
110110
- 🟥 Make a flag for **major dev/changes**: all users of the code should agree and sign off (git reviews), and this includes the PI.
111-
- 🟧 Make a flag for **user-needs**: this is needed to stop a block -- it might not be perfect, so make an issue to revisit later. 1 sign off from another user, and go! 🚀
111+
- 🟧 Make a flag for **user-needs**: this is needed to stop a block -- it might not be perfect, so make an issue to revisit later. 1 sign off from another user, and go! 🚀
112112
- 🟩 Make a flag for **minor change**: not breaking, can be changed later, 1 sign off okay
113113

114114
### Git Workflow
@@ -137,7 +137,7 @@ I recommend the following system for within-lab projects that have different lev
137137

138138
1. **Team Communication**
139139
- Use appropriate channels for different purposes - use basecamp campfire and github issues/PRs
140-
- Be clear and concise
140+
- Be clear and concise
141141
- Document important decisions!!
142142
- Share knowledge and learnings
143143

@@ -200,13 +200,13 @@ We use the Google Style Guide: https://google.github.io/styleguide/
200200
- Spaces after commas and semicolons
201201

202202
4. **Naming Conventions**
203-
- Variables: `lower_snake_case`
204-
- Functions: `lower_snake_case`
205-
- Classes: `PascalCase`
206-
- onstants: `UPPER_SNAKE_CASE`
207-
- Files: `lower_snake_case.py`
208-
- Private members: `_single_leading_underscore`
209-
- Modules/Packages: `lower_snake_case`
203+
- Variables: `lower_snake_case`
204+
- Functions: `lower_snake_case`
205+
- Classes: `PascalCase`
206+
- onstants: `UPPER_SNAKE_CASE`
207+
- Files: `lower_snake_case.py`
208+
- Private members: `_single_leading_underscore`
209+
- Modules/Packages: `lower_snake_case`
210210
- Interfaces: `PascalCase` (same as classes, no special prefix)
211211

212212
5. **Comments**
@@ -270,4 +270,4 @@ We use the Google Style Guide: https://google.github.io/styleguide/
270270

271271
---
272272

273-
Remember: These guidelines are living documents. Feel free to suggest improvements and updates as the team evolves and learns.
273+
Remember: These guidelines are living documents. Feel free to suggest improvements and updates as the team evolves and learns.

docs/HowTo_JupyterBook.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ To then deploy the book live, see: https://jupyterbook.org/en/stable/publish/gh-
4040
In short, Go to Settings > Pages and set up anaction to deploy to a new branch (that you never merge) called `gh-pages`:
4141

4242
![Screen Shot 2025-06-17 at 2 20 19 PM](https://github.com/user-attachments/assets/17d13802-6543-4859-ac09-7abbd491277d)
43-
44-

docs/StyleGuide.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Please see our overall guide on code & project formatting [here](https://github.com/AdaptiveMotorControlLab/WorkspaceTemplate/blob/main/README.md).
77

8-
### Main Principles 🔨 Organize your code & data:
8+
### Main Principles 🔨 Organize your code & data:
99
- For experimental and ML projects, please use [DataJoint/databases](https://www.datajoint.com/)
1010
- Be sure you work under a lab repo, typically called "https://github.com/AdaptiveMotorControlLab/YourName_workspace".
1111
- For larger projects (DLC, CEBRA, ExperimentalPipelines, you should be sure your "final" work gets into a pipeline; talk to Mackenzie about this)
@@ -19,7 +19,7 @@ Please see our overall guide on code & project formatting [here](https://github.
1919

2020

2121

22-
## Ready to write up your work and share your hard work, data, & code?
22+
## Ready to write up your work and share your hard work, data, & code?
2323
Here is how to do so most efficiently with me.
2424

2525
- 🚨 First, I recommend having a one-on-one so we can lay out the paper sketch, authors, data and code sharing plan together if not already done.
@@ -92,10 +92,10 @@ ax.xaxis.label.set_color("white")
9292
```
9393

9494

95-
### Timeline Major Point:
95+
### Timeline Major Point:
9696

97-
For conference submissions, all papers must be in final form 1 week prior to the deadline.
98-
There will be no exceptions going forward.
99-
This gives us needed time to reflect, refine writing, get some distance, and ask colleagues for feedback.
100-
It also gives us time to prepare the code submission, and potentially arXiv the work -- which is always preferred.
101-
We should not be submitting manuscripts to conferences we would not want publicly read!
97+
For conference submissions, all papers must be in final form 1 week prior to the deadline.
98+
There will be no exceptions going forward.
99+
This gives us needed time to reflect, refine writing, get some distance, and ask colleagues for feedback.
100+
It also gives us time to prepare the code submission, and potentially arXiv the work -- which is always preferred.
101+
We should not be submitting manuscripts to conferences we would not want publicly read!

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ based_on_style = "google"
77
indent_width = 4
88

99
[tool.isort]
10-
force_single_line = true
10+
force_single_line = false
1111
force_sort_within_sections = false
1212
lexicographical = true
1313
single_line_exclusions = ['typing']

requirements.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
numpy
2+
pandas
3+
scipy
4+
matplotlib
5+
seaborn
6+
cebra
7+
pytest
8+
pytest-cov
9+
isort
10+
yapf

0 commit comments

Comments
 (0)