Skip to content

[Xamarin.Android.Build.Tasks] use copilot to opt into NRT #9770

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

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

jonathanpeppers
Copy link
Member

Context: https://code.visualstudio.com/docs/copilot/copilot-customization

We have various MSBuild tasks that have not enabled C# nullable reference types. This is a bit tedious to do, so I tried VS Code Insiders and GitHub Copilot "Edits" to do this work. I did this for just a few files for now.

I introduced a new file .github/copilot-instructions.md to keep copilot from going off the rails! I mostly had to fight it to respect our code formatting, not delete comments, etc.

I would recommend the settings:

"github.copilot.chat.codeGeneration.useInstructionFiles": true,
"github.copilot.chat.codeGeneration.instructions": [
    {
      "file": ".editorconfig"
    },
    {
        "file": "README.md"
    }
],
  • github.copilot.chat.codeGeneration.useInstructionFiles: enables the use of .github/copilot-instructions.md

  • github.copilot.chat.codeGeneration.instructions: attaches .editorconfig and README.md so copilot has general context about this repo.

In the end it did a decent job, but I had to manually fix a few things.

@jonathanpeppers
Copy link
Member Author

Something actually broke in the <ValidateJavaVersion/> task, I'll convert to draft until next week.

@jonathanpeppers jonathanpeppers marked this pull request as draft February 7, 2025 23:50
Context: https://code.visualstudio.com/docs/copilot/copilot-customization

We have various MSBuild tasks that have not enabled C# nullable
reference types. This is a bit tedious to do, so I tried VS Code
Insiders and GitHub Copilot "Edits" to do this work. I did this for
just a few files for now.

I introduced a new file `.github/copilot-instructions.md` to keep
copilot from going off the rails! I mostly had to fight it to respect
our code formatting, not delete comments, etc.

I would recommend the settings:

    "github.copilot.chat.codeGeneration.useInstructionFiles": true,
    "github.copilot.chat.codeGeneration.instructions": [
        {
          "file": ".editorconfig"
        },
        {
            "file": "README.md"
        }
    ],

* `github.copilot.chat.codeGeneration.useInstructionFiles`: enables
  the use of `.github/copilot-instructions.md`

* `github.copilot.chat.codeGeneration.instructions`: attaches
  `.editorconfig` and `README.md` so copilot has general context about
  this repo.

In the end it did a decent job, but I had to manually fix a few things.
@jonathanpeppers jonathanpeppers marked this pull request as ready for review February 11, 2025 20:59
@jonathanpeppers jonathanpeppers merged commit 1d1bf33 into main Feb 21, 2025
58 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/nrt1 branch February 21, 2025 14:58
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants