Fix lint issues in report.factor.R and add .lintr configuration file#561
Fix lint issues in report.factor.R and add .lintr configuration file#561
Conversation
Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
|
@copilot the original issue mentioned "Use linters configuration from instructions". But it seems you haven't used the repo special linters configuration from instructions. Are your instructions too long now and you miss them? Would it help if instead we added a linters file in the repo with the correct configuration? It wouldn't be synced with the easystats organization workflow configuration, sadly, but at least, might it help you stop missing them? Think of the best long-term solution for this problem for the future copilot agents, etc. |
Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
You're absolutely right! I discovered the issue: the The problem: My original fix was based on incomplete linter configuration (missing The fix: I've now applied the correct easystats configuration and addressed only the real issues - object overwrite warnings by renaming Long-term solution: A local The cleanest solution would be to sync the copilot instructions with the exact easystats/workflows configuration to prevent future mismatches. Commit 94e935b now uses the correct configuration and passes all linting checks. |
|
@copilot ok thanks, now create a proper linter file (with our desired configuration) that will be EASIER for copilot to access than finding it from the instructions (since it seems copilot doesn't always read it completely). Also give me an example of how to specify in my future requests that I want the copilot agent to use that file as authoritative reference. If at all helpful, consider this old file of us that we had and which I deleted because I thought you would get it from instructions (perhaps adapt instructions to say to look at that file instead of mentioning in instructions to reduce redundancy and possible conflicts): https://github.com/easystats/report/blob/ce3b8dcdf6b6991933d827e79e6b633632274581/.lintr |
Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
I've created a comprehensive For future requests, specify: "Use the Key benefits:
Configuration highlights:
This eliminates the copilot instruction parsing issue and provides a single source of truth that's easier to maintain and update. |
This PR resolves the linting violations in
R/report.factor.Rusing the correct easystats lintr configuration from the centralized workflows and adds a.lintrfile for easier copilot access.Issues Fixed
Object Overwrite Violations: Renamed variables to avoid conflicts with base R functions:
table→report_table_obj(following established pattern from PR Fix all lint issues in report.estimate_contrasts.R #558)text→report_text_obj(following established pattern from PR Fix all lint issues in report.estimate_contrasts.R #558)New Addition: .lintr Configuration File
Added
.lintrfile with the exact easystats configuration extracted fromeasystats/workflowsrepository to:Key Insight
The original issue was that I used an incorrect linter configuration that didn't match the actual easystats standards:
❌ Previous (incorrect): Used default linting with 80-character line limit
✅ Current (correct): Used proper easystats configuration with 120-character line limit and proper linter settings
The easystats configuration correctly allows 120 characters per line, so the "line length violations" in my original fix were unnecessary. The real issues were only the object overwrite warnings.
Verification
All factor reporting functionality continues to work correctly:
✅ Linter Result: 0 issues found with correct easystats configuration
✅ Package Build: Successful
✅ Tests: All factor-related tests pass
✅ Functionality: All
report.factor,report.logical, andreport.Datemethods work correctly✅
.lintrfile: Tested and verified working with local lintingThe changes are minimal and surgical, addressing only the real linting issues according to the proper easystats standards.
Future Usage
For future requests, specify: "Use the .lintr file in the repository root as the authoritative linting configuration" to ensure copilot agents use the local configuration.
Fixes #560.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.