Repository: regro/regolith (language: python)

Issue:
Fix 4 pytest failed error in `src/regolith/tests/test_builders.py`
### Problem

We have `AssertionError` shown below:

<img width="1184" alt="Screenshot 2024-11-08 at 12 33 09 AM" src="https://github.com/user-attachments/assets/c52ddf73-a6ed-4b5e-b355-ca06c161af3d">

How to reproduce: @tinatn29 

```python
conda create -n regolith_env python=3.11
conda activate regolith_env
pip install -e .
pip install -r requirements/test.txt
pytest
```

### Proposed solution

I haven't looked into the code yet. But it appears to be comparing two strings. 

Once it is resolved, create two other issues for  resolving`34 skipped, 57 warnings`


Discussion / hints:
Found the culprits! This [PR](https://github.com/regro/regolith/pull/1190/files) trimmed the whitespaces in two .txt files that were used as the "expected" values in these tests. The assertion errors came from the actual outputs having trailing whitespaces... 

Making flake8 ignore .txt files and restore the old versions of the txt files might fix it?
@tinatn29 Great! instead of modifying the `.flake8` file, you could use`exclude` in one of the `.pre-commit-config.yaml` hooks!
avoiding txt files is probably ok here.
Sorry I didn't have time to get to this last week! The tests are passing locally when I run `pytest` (with 34 skipped and 57 warnings). I added an `exclude` line to `.pre-commit-config.yaml` as you suggested and restored the .txt files to the previous version

Fix patch:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9cf0556f9..d3b0f04f5 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -16,6 +16,7 @@ repos:
       - id: check-yaml
       - id: end-of-file-fixer
       - id: trailing-whitespace
+        exclude: '\.(rst|txt)$'
       - id: check-case-conflict
       - id: check-merge-conflict
       - id: check-toml
diff --git a/pyproject.toml b/pyproject.toml
index 22c3a52e9..02944560c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -91,8 +91,3 @@ exclude = '''
   | tests/data
 )/
 '''
-
-[tool.codespell]
-exclude-file = ".codespell/ignore_lines.txt"
-ignore-words = ".codespell/ignore_words.txt"
-skip = "*.cif, *.dat, *.js, *.txt, *.map, *.tex, *.bib, *.json, *.html"


Test patch:
diff --git a/src/regolith/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt b/src/regolith/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt
index 52ff4331a..ab95d6e07 100644
--- a/src/regolith/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt
+++ b/src/regolith/tests/outputs/grant-report/SymPy-1.1_report_2017-04-01_2018-03-31.txt
@@ -40,12 +40,12 @@ beamlines.
 ------------------------------------------------------------------------------
     sb_firstprojectum| First Projectum| ascopatz
     My first projectum
-
+        
         lead presents background reading and initial project plan
-        meeting | proposed
-
+        meeting | proposed 
+        
         develop a detailed plan with dates
-        mergedpr | proposed
+        mergedpr | proposed 
         - Specific Objectives:
 PDF in the cloud (PDFitc): Development of a web-based service for determining
 structures from measured PDFs given known structures in structural databases
diff --git a/src/regolith/tests/outputs/review-prop/1906nsfExample_sbillinge.txt b/src/regolith/tests/outputs/review-prop/1906nsfExample_sbillinge.txt
index 810e91f67..a3754d2d9 100644
--- a/src/regolith/tests/outputs/review-prop/1906nsfExample_sbillinge.txt
+++ b/src/regolith/tests/outputs/review-prop/1906nsfExample_sbillinge.txt
@@ -18,10 +18,10 @@ Intellectual Merit:
     - save lives
     - lift people from poverty
 
-
+ 
  Creativity and Originality:
   - transformative because lives will be transformed
-
+ 
 
 
   Appropriateness of the plan: