Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Jun 21, 2025

User description

Add instructions for copilot for PR reviews. Based on the Cursor rules file.


PR Type

Documentation


Description

  • Add comprehensive GitHub Copilot instructions for PR reviews

  • Define project context and Fortran/Fypp coding standards

  • Establish OpenACC GPU programming guidelines

  • Create structured review checklist for code quality


Changes walkthrough 📝

Relevant files
Documentation
copilot-instructions.md
Add Copilot PR review instructions                                             

.github/copilot-instructions.md

  • Create comprehensive Copilot instructions for MFC project reviews
  • Define Fortran 2008+ coding standards and naming conventions
  • Establish OpenACC GPU programming guidelines and best practices
  • Provide structured checklist for code quality verification
  • +77/-0   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copilot AI review requested due to automatic review settings June 21, 2025 18:03
    Copy link
    Contributor

    Copilot AI left a comment

    Choose a reason for hiding this comment

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

    Pull Request Overview

    This PR introduces a new GitHub Copilot instructions document for providing pull-request reviews specifically tailored for this repository.

    • Adds comprehensive review guidelines including project context, incremental workflow, style conventions, OpenACC guidelines, and a review checklist.
    • Provides formatting standards and best practices for Fortran and auxiliary files like Fypp templates.
    Comments suppressed due to low confidence (2)

    .github/copilot-instructions.md:33

    • [nitpick] Consider adding concrete examples for the case transformation rules to help new contributors clearly understand the expected formatting.
    Case	Lower-case keywords & intrinsics (do, end subroutine, …).
    

    .github/copilot-instructions.md:71

    • [nitpick] Consider providing more detailed build instructions or linking to a separate documentation page so that contributors have a clear procedure for verifying buildability.
    1.	Buildability: PR includes build instructions or CI passes the staged build.
    

    @qodo-merge-pro
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Formatting Issue

    The table in section 3 appears to be malformed with inconsistent formatting. The header row lacks proper markdown table syntax and column alignment may be unclear for automated parsing.

    Element	Rule
    Indentation	2 spaces; continuation lines align beneath &.
    Case	Lower-case keywords & intrinsics (do, end subroutine, …).
    Modules	m_<feature> (e.g. m_transport).
    Public subroutines	s_<verb>_<noun> (s_compute_flux).
    Public functions	f_<verb>_<noun>.
    Routine size	subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, file ≤ 1000.
    Arguments	≤ 6; else use a derived-type params struct.
    Forbidden	goto (except legacy), COMMON, save globals.
    Variables	Every arg has explicit intent; use dimension/allocatable/pointer as appropriate.
    Errors	Call s_mpi_abort(<msg>), never stop or error stop.
    Missing Context

    The OpenACC code example lacks proper context and explanation. The directive example should include more complete syntax or reference where full examples can be found.

    !$acc parallel loop gang vector default(present) reduction(...)
    

    @qodo-merge-pro
    Copy link
    Contributor

    qodo-merge-pro bot commented Jun 21, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Format code blocks properly
    Suggestion Impact:The commit implemented the exact changes suggested: added fenced code block syntax around the Fortran OpenACC code example and converted tab-based bullet points to standard Markdown list syntax

    code diff:

    +```fortran
     !$acc parallel loop gang vector default(present) reduction(...)
    +```
     
    -*	Add collapse(n) when safe.
    -*	Declare loop-local variables with private(...).
    -*	Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    -*	Avoid stop/error stop inside device code.
    -*	Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.
    -
    -Copilot, when reviewing:
    -* Verify directives and data-movement are correct.
    -* Point out host-device violations, missing private, or illegal stops.
    -* Check that helper routines called from accelerated regions include !$acc routine seq.
    +* Add collapse(n) when safe.
    +* Declare loop-local variables with private(...).
    +* Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    +* Avoid stop/error stop inside device code.
    +* Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.

    The OpenACC code example should be properly formatted as a code block for better
    readability. The bullet points use inconsistent formatting with tab characters
    instead of standard Markdown list syntax.

    .github/copilot-instructions.md [54-60]

    +```fortran
     !$acc parallel loop gang vector default(present) reduction(...)
    +```
     
    -*	Add collapse(n) when safe.
    -*	Declare loop-local variables with private(...).
    -*	Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    -*	Avoid stop/error stop inside device code.
    -*	Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.
    +* Add collapse(n) when safe.
    +* Declare loop-local variables with private(...).
    +* Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    +* Avoid stop/error stop inside device code.
    +* Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly points out that the Fortran code snippet should be in a fenced code block for proper rendering and syntax highlighting. The improved_code also correctly cleans up the list formatting by removing tabs, which improves the overall quality and readability of the documentation.

    Medium
    Fix broken table formatting
    Suggestion Impact:The suggestion was directly implemented - the tab-separated table was converted to proper Markdown table format with pipes, headers, and alignment separators exactly as suggested

    code diff:

    -Element	Rule
    -Indentation	2 spaces; continuation lines align beneath &.
    -Case	Lower-case keywords & intrinsics (do, end subroutine, …).
    -Modules	m_<feature> (e.g. m_transport).
    -Public subroutines	s_<verb>_<noun> (s_compute_flux).
    -Public functions	f_<verb>_<noun>.
    -Routine size	subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, file ≤ 1000.
    -Arguments	≤ 6; else use a derived-type params struct.
    -Forbidden	goto (except legacy), COMMON, save globals.
    -Variables	Every arg has explicit intent; use dimension/allocatable/pointer as appropriate.
    -Errors	Call s_mpi_abort(<msg>), never stop or error stop.
    +| Element | Rule |
    +|---------|------|
    +| Indentation | 2 spaces; continuation lines align beneath &. |
    +| Case | Lower-case keywords & intrinsics (do, end subroutine, …). |
    +| Modules | m_<feature> (e.g. m_transport). |
    +| Public subroutines | s_<verb>_<noun> (s_compute_flux). |
    +| Public functions | f_<verb>_<noun>. |
    +| Routine size | subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, file ≤ 1000. |
    +| Arguments | ≤ 6; else use a derived-type params struct. |
    +| Forbidden | goto (except legacy), COMMON, save globals. |
    +| Variables | Every arg has explicit intent; use dimension/allocatable/pointer as appropriate. |
    +| Errors | Call s_mpi_abort(<msg>), never stop or error stop. |

    The table formatting is broken and difficult to read. Use proper Markdown table
    syntax with pipes and headers to make the style guidelines clearly readable and
    parseable.

    .github/copilot-instructions.md [31-41]

    -Element	Rule
    -Indentation	2 spaces; continuation lines align beneath &.
    -Case	Lower-case keywords & intrinsics (do, end subroutine, …).
    -Modules	m_<feature> (e.g. m_transport).
    -Public subroutines	s_<verb>_<noun> (s_compute_flux).
    -Public functions	f_<verb>_<noun>.
    -Routine size	subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, file ≤ 1000.
    -Arguments	≤ 6; else use a derived-type params struct.
    -Forbidden	goto (except legacy), COMMON, save globals.
    -Variables	Every arg has explicit intent; use dimension/allocatable/pointer as appropriate.
    -Errors	Call s_mpi_abort(<msg>), never stop or error stop.
    +| Element | Rule |
    +|---------|------|
    +| Indentation | 2 spaces; continuation lines align beneath &. |
    +| Case | Lower-case keywords & intrinsics (do, end subroutine, …). |
    +| Modules | m_<feature> (e.g. m_transport). |
    +| Public subroutines | s_<verb>_<noun> (s_compute_flux). |
    +| Public functions | f_<verb>_<noun>. |
    +| Routine size | subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, file ≤ 1000. |
    +| Arguments | ≤ 6; else use a derived-type params struct. |
    +| Forbidden | goto (except legacy), COMMON, save globals. |
    +| Variables | Every arg has explicit intent; use dimension/allocatable/pointer as appropriate. |
    +| Errors | Call s_mpi_abort(<msg>), never stop or error stop. |
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion correctly identifies that the tab-separated values are not standard Markdown for a table. Using pipe tables as suggested in the improved_code is the correct syntax, which improves readability and ensures proper rendering.

    Low
    General
    Fix inconsistent list formatting
    Suggestion Impact:The suggestion was directly implemented - the bullet points were changed from tab characters and asterisks to standard markdown asterisks with consistent spacing, and the code example was wrapped in a fortran code block

    code diff:

    +```fortran
     !$acc parallel loop gang vector default(present) reduction(...)
    +```
     
    -*	Add collapse(n) when safe.
    -*	Declare loop-local variables with private(...).
    -*	Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    -*	Avoid stop/error stop inside device code.
    -*	Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.
    -
    -Copilot, when reviewing:
    -* Verify directives and data-movement are correct.
    -* Point out host-device violations, missing private, or illegal stops.
    -* Check that helper routines called from accelerated regions include !$acc routine seq.
    +* Add collapse(n) when safe.
    +* Declare loop-local variables with private(...).
    +* Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    +* Avoid stop/error stop inside device code.
    +* Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.

    The bullet points use tab characters and asterisks inconsistently, making the
    list hard to read. Use standard Markdown list syntax with consistent spacing and
    proper indentation for better readability.

    .github/copilot-instructions.md [52-60]

     Wrap tight loops:
     
    +```fortran
     !$acc parallel loop gang vector default(present) reduction(...)
    +```
     
    -*	Add collapse(n) when safe.
    -*	Declare loop-local variables with private(...).
    -*	Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    -*	Avoid stop/error stop inside device code.
    -*	Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.
    +* Add collapse(n) when safe.
    +* Declare loop-local variables with private(...).
    +* Allocate large arrays with managed or move them into a persistent !$acc enter data region at start-up.
    +* Avoid stop/error stop inside device code.
    +* Code must compile with Cray ftn, NVIDIA nvfortran, GNU gfortran, and Intel ifx/ifort.
    Suggestion importance[1-10]: 4

    __

    Why: The suggestion correctly identifies that the list formatting could be improved for better readability. The proposed change to use standard markdown for the list and to wrap the code example in a fortran block is a good stylistic improvement for this new documentation file.

    Low
    • Update

    @sbryngelson sbryngelson merged commit f68bce1 into MFlowCode:master Jun 21, 2025
    11 checks passed
    @sbryngelson sbryngelson deleted the copilot-instruction branch June 22, 2025 02:49
    prathi-wind pushed a commit to prathi-wind/MFC-prathi that referenced this pull request Jul 13, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Development

    Successfully merging this pull request may close these issues.

    1 participant