Skip to content

Commit 792d014

Browse files
authored
Merge pull request lammps#4791 from akohlmey/collected-small-changes
Collected small changes and fixes
2 parents fac62e9 + 6d47678 commit 792d014

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+601
-292
lines changed

.github/copilot-instructions.md

Lines changed: 115 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,123 @@ to LAMMPS in https://docs.lammps.org/Modify_requirements.html
314314
When performing a code review, apply the programming style instructions
315315
for LAMMPS in https://docs.lammps.org/Modify_style.html
316316

317-
When performing a code review, check any changes to the documentation (in the
318-
`doc/src/` folder) to be written in American English and with plain ASCII characters.
317+
When performing a code review, check any changes to the documentation
318+
(in the `doc/src/` folder) to be written in American English and with
319+
plain ASCII characters.
319320

320321
When performing a code review, ensure that the documentation for any new
321-
commands or added keywords to existing commands contains a `.. versionadded:: TBD`
322-
directive. For any modified commands or keywords a `.. versionchanged:: TBD`
323-
directive should be included in the documentation. Check if any examples use
324-
the new or modified commands and check if they need updating. Ensure that
325-
building the documentation with "make html", "make pdf", and "make spelling"
326-
can complete and does *NOT* produce any *NEW* warnings or errors.
322+
commands or added keywords to existing commands contains a
323+
`.. versionadded:: TBD` directive. For any modified commands or
324+
keywords a `.. versionchanged:: TBD` directive should be included in the
325+
documentation. Check if any examples use the new or modified commands
326+
and check if they need updating. Ensure that building the documentation
327+
with "make html", "make pdf", and "make spelling" can complete and does
328+
*NOT* produce any *NEW* warnings or errors.
329+
330+
When reviewing C++ code, ensure that no alternative tokens are used for
331+
logical operators. That is, use `&&` instead of `and`, `||` instead of
332+
`or`, `!` instead of 'not', `^` instead of `xor` and so on. These
333+
alternative tokens are only required for ASCII text in some non
334+
US-English characters sets, but the LAMMPS sources code are *supposed*
335+
be in US-English 7-bit ASCII. Using alternative tokens causes
336+
compilation failures with some compilers by default, most prominently
337+
Microsoft Visual C++.
338+
339+
## Documentation Changes
340+
341+
When modifying documentation files in `doc/src/`:
342+
343+
**Build and validate documentation:**
344+
```bash
345+
cd doc
346+
make html # Build HTML, check for warnings
347+
make pdf # Build PDF (requires pdflatex)
348+
make spelling # Check spelling
349+
make anchor_check # Check for duplicate anchors
350+
make style_check # Verify style lists are complete
351+
```
352+
353+
**Documentation conventions:**
354+
- Use reStructuredText format (`.rst` files)
355+
- Use American English spelling
356+
- Use ASCII characters only
357+
- Wrap code examples in `.. code-block::` with appropriate language (LAMMPS, bash, c++, python)
358+
- Use `.. note::` for important remarks and `.. warning::` for critical warnings
359+
- New commands require `.. versionadded:: TBD`
360+
- Modified commands require `.. versionchanged:: TBD`
361+
362+
## Debugging CI Failures
363+
364+
When a CI check fails, diagnose using these steps:
365+
366+
**1. Style check failures (`style-check.yml`):**
367+
```bash
368+
cd src
369+
make check-whitespace # Most common - fix with: make fix-whitespace
370+
make check-permissions # Fix with: make fix-permissions
371+
make check-homepage # Verify https://www.lammps.org URLs
372+
make check-errordocs # Check error documentation
373+
make check-fmtlib # Verify fmtlib formatting
374+
```
375+
376+
**2. Build failures:**
377+
- Check CMake output for missing dependencies
378+
- Ensure `-S cmake` (not `-S .`) is used
379+
- Verify package dependencies are met
380+
- Check for VLA (variable-length array) usage - not allowed
381+
382+
**3. Unit test failures:**
383+
- Run specific failing test: `cd build && ctest -V -R <test_name>`
384+
- Check if test requires specific packages to be enabled
385+
- Verify the executable was built before running tests
386+
387+
**4. Regression test failures:**
388+
- Ensure Python environment has numpy, pyyaml, junit_xml
389+
- Check if example inputs were modified correctly
390+
391+
## Short-Circuit Instructions
392+
393+
**STOP and check these common mistakes:**
394+
395+
1. **Wrong CMake source directory:**
396+
- WRONG: `cmake -S . -B build`
397+
- CORRECT: `cmake -S cmake -B build`
398+
399+
2. **Building in source tree:**
400+
- NEVER run cmake or make in the repository root
401+
- ALWAYS create a separate `build/` directory
402+
403+
3. **Mixed build systems:**
404+
- If switching from Make to CMake: run `make -C src purge` first
405+
- If switching from CMake to Make: run `make -C src clean-all` first
406+
407+
4. **Unicode in source files:**
408+
- All source code must be ASCII only
409+
- Unicode characters will cause CI to fail
410+
411+
5. **Missing whitespace fixes:**
412+
- Always run `cd src && make fix-whitespace` before committing
413+
414+
6. **Incorrect file permissions:**
415+
- `.cpp` and `.h` files must NOT be executable
416+
- `.sh` and `.py` scripts SHOULD be executable
417+
418+
## Sample Prompts
419+
420+
**Adding a new pair style:**
421+
> "Create a new pair style called `pair_example` that implements [description]. Follow the pattern in `src/pair_lj_cut.cpp` and add documentation in `doc/src/pair_example.rst`."
422+
423+
**Fixing a bug in a compute:**
424+
> "Fix bug in `compute_temp.cpp` where [description]. Add a unit test in `unittest/` to prevent regression."
425+
426+
**Adding a new package:**
427+
> "Create a new package called MYPACKAGE with [features]. Include CMakeLists.txt entries, documentation, and example inputs."
428+
429+
**Updating documentation:**
430+
> "Update the documentation for `fix_nve.rst` to include the new `keyword` option. Use `.. versionchanged:: TBD` directive."
431+
432+
**Debugging build failure:**
433+
> "The CI build is failing with [error]. Diagnose and fix the issue."
327434
328435
## Trust These Instructions
329436

.github/workflows/check-cpp23.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
3434
with:
3535
fetch-depth: 2
3636

.github/workflows/check-gnu-make.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2626
with:
2727
fetch-depth: 2
2828

.github/workflows/check-vla.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2626
with:
2727
fetch-depth: 2
2828

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v5
28+
uses: actions/checkout@v6
2929
with:
3030
fetch-depth: 2
3131

.github/workflows/compile-msvc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout repository
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@v6
3030
with:
3131
fetch-depth: 2
3232

.github/workflows/coverity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 2
2222

.github/workflows/full-regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@v6
2727
with:
2828
fetch-depth: 2
2929
show-progress: false

.github/workflows/lammps-gui-flatpak.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v5
23+
uses: actions/checkout@v6
2424
with:
2525
fetch-depth: 2
2626

.github/workflows/quick-regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v5
30+
uses: actions/checkout@v6
3131
with:
3232
fetch-depth: 0
3333
show-progress: false

0 commit comments

Comments
 (0)