Comments (5)
The way haml-lint
does this is by creating a temporary file in the same directory as the original .haml
file being linted. This results in rubocop
automatically using the correct configuration.
Is there any possibility you could do the same? I would rather not include a hack for a specific linter if it can be avoided.
from haml-lint.
Thank you for the response.
My package is very simple and I feel a bit like I'm standing with one leg each on the shoulders of two giants (haml-lint and atom's linter), delicately pointing them both in the right direction. :)
The behavior of linter to write files to /tmp is quite deeply ingrained and not configurable. While I can't speak for the intent of the authors, I suspect it may be intentional. Node's tempfile utilities do not have the magic of ruby's TempFile
class where the tempfile gets cleaned up with garbage collection pretty much no matter what. By writing to /tmp, no garbage is left behind within the source code in the event of the unexpected, e.g. if the editor crashes.
I'm much more familiar with ruby than node, so this is the natural direction for me to turn first. It seems like the fact that Rubocop::CLI#run accepts overriding ARGV
is a boon for HamlLint::CLI
to accept a separate option for the location of .rubocop.yml
and pass it through in a straight-forward manner.
I know it feels like a bit of a kludge to have two options for config files and this is definitely an edge case, but there are two separate linters at play here. Would you be willing to entertain a pull request that does what I have described?
from haml-lint.
One last question: is it possible for you to set an environment variable before executing haml-lint
?
Rather than expose a flag on the command-line (and having to maintain code that passes that all the way through to the linter), I'd be more comfortable with an environment variable (something like HAML_LINT_RUBOCOP_CONF
) that the RuboCop
linter can recognize and pass on as a flag to Rubocop::CLI#run
.
This would allow the code to only exist in the RuboCop
linter, maintaining isolation from the rest of the system.
from haml-lint.
Setting an environment variable is definitely doable, I have submitted a pull request to linter to support it.
from haml-lint.
Closing as this seems to have lost steam. Feel free to reopen when this is ready to pursue again.
from haml-lint.
Related Issues (20)
- False positive Rails/HttpStatus HOT 1
- Failing spec on main branch HOT 2
- Add support to Haml 6.2
- `haml-lint:disable` is ignored when line breaks on commas are present
- Add `-s`/`--stdin` option support HOT 2
- Allow Haml 6.3 HOT 3
- Haml 6.2 actions are not listed among required checks HOT 1
- Failing spec on main (local environment, up to date rubocop)
- Issue with Rubocop `Layout/IndentationConsistency` interaction with haml comment blocks HOT 2
- Version 0.53.0 has not been pushed to Rubygems HOT 1
- RuboCop: Lint/Syntax: unexpected token tSYMBOL and kEND HOT 5
- 0.54.0: Too many files open HOT 4
- Layout/ArgumentAlignment - False positive? HOT 2
- Feature Suggestion: require strict locals
- Possible false positives with Rails/FindEach
- Lint/Syntax: unexpected token kDO_BLOCK | Lint/Syntax: unexpected token kEND HOT 1
- False positive with Layout/SpaceInsideParens for multi-line attributes HOT 4
- Allow multiple reporters?
- False positive on the `UnnecessaryStringOutput` cop
- Style/IfUnlessModifier - Potential False Positive as of 0.46.0 HOT 5
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 haml-lint.