Comments (8)
@chshersh sorry, do you mean something like:
data Suggestion = Suggestion
{ suggestionLine : Line
, suggestionFile : FilePath
, suggestionChange : LineChange
}
data LineChange = LineChange
{ lineChangeNew :: Text
, lineChangeComment :: Maybe Text -- ^ Optional comment to the suggestion
, lineChangeType :: ChangeType
} deriving (Eq, Show)
?
from hintman.
Perhaps it might make sense to have a "suggestion type" union type, so we know that if the suggestion is of type "delete line" every other suggestion on that line can be discarded?
from hintman.
Does #3 suit?
from hintman.
@nixorn Is working on the Config
type for checks. So we can add one more field to the Suggestion
data type with something like suggestionType :: SuggestionType
and then we can implement Semigroup
instance for Suggestion
that will handle joining of suggestions for us.
Not in PR #3, in separate PR, we're just discussing the architecture here
from hintman.
I'm implementing suggestionType
in #14 , I have a doubt: Suggest
currently does not have a line number, shouldn't it have one? how would we link a line number (input) with the suggestion otherwise? do you think it's better to have a Line
type inside Suggest
or just a suggestLineNumber
field?
from hintman.
@sphaso I think you can rename Suggest
data type to LineChange
(or better name) and also introduce new data type:
data Suggestion = Suggestion
{ suggestionLine :: Line
, suggestionChange :: SuggestionChange
}
from hintman.
@sphaso This also looks valid
from hintman.
I've just pushed the types discussed above in #14
from hintman.
Related Issues (20)
- Speed up tests by fetching PRs only once
- Add headers to Trailing* hints HOT 1
- Improve README
- Add tests for multiple hints in different hunks
- [RFC] Use multiline comment API to leave multiline comments HOT 2
- Display code duplication HLint suggestions better
- Log HLint errors
- [RFC] Rust support HOT 3
- [RFC] A lint for a lacking newline at the end of file HOT 1
- Investigate `endOfInputError` HOT 1
- Split file contents in the lines only once
- Use the correct base repo for downloading PR sources HOT 6
- Test consistency of `TrailingNewline` and `NoNewlineAtFileEnd`
- Bad credentials error
- Bump up GHC
- Support folders/files ignore
- Instructions how to uninstall HOT 1
- Use HLint 3.0
- Deprecation of some of the GitHub events
- Stylish-haskell and Ormolu support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hintman.