Comments (27)
Thanks to the work of @prashcr and some minor tweaking from yours truly, we now have tests running with a Docker image on Travis CI. The results are speedy, and the output is readable enough. You can see the log from one of the builds here: https://travis-ci.org/w0rp/ale/builds/167205251
If you can get Docker installed on your machine, you can run them locally by running just make
. (I was able to set up so make
is the same as make test
.)
Let's all thank @prashcr for the work he put into this. It's good stuff. 👍
Now we can go about adding some of these tests so they'll actually run on Travis CI. I'll have a look at some of the other pull requests tomorrow, now I've gotten the test suite to run.
from ale.
I was finally able to get a test to run a job. I added a function which checks the job status and waits with sleep
in a loop with a timeout to support blocking until linting is complete for the benefit of tests. I didn't add it to the documentation, as I don't intend for the function to be used outside of this plugin.
from ale.
And how do we install linters? There are a lot of dependencies involved (pip
, npm
...). Maybe we should focus first on the ones installable from repositories like gcc
and shellcheck
?
Take a look at the sh test implemented in validator, its a very simple one and check only if the pattern used in linter handler is valid.
from ale.
We can install whatever via pip
, npm
, etc on Travis CI. We could start with just one linter which will cover most of the cases above. Travis CI currently caches pip
installed modules, so it shouldn't slow builds down that much.
from ale.
We could also perhaps make use of virtualenv
, but Docker is also being introduced into the mix. Either way, it can be done.
from ale.
Good to know, I'm not familiar at all with Docker and Travis.
from ale.
Unit test the loclist sorting.
Actually, the loclist is sorted by line numbers, and IMO it should be sorted by severity (Errors first then warnings).
from ale.
The loclist has to be sorted by line and then column for the binary search used by the cursor functions to work.
from ale.
The current sorting is also used by the signs functions for showing errors instead of warnings when a line contains both warnings and errors.
from ale.
Why not just bundle the linters in our docker image?
from ale.
Yep, whatever programs can be put in the Docker image.
from ale.
I have started adding tests. This should complement the work from @prashcr on adding the Docker image for running tests on Travis CI. We can start adding tests which pass locally, and get them on Travis CI when that is ready to go.
I managed to catch a bug and fix it in the process, so Vader is looking good to me.
from ale.
I'll make a note, if anyone can figure out a decent way to get NeoVim included in the build too, then that would be a very good next step.
from ale.
There is a pending PR on the vim-testbench repo adding neovim support, so I would say wait a few days and then see what they come up with.
from ale.
Good job guys, the plugin is far better than before 👍
Sorry for not being available, but I was and still very busy with personal problems (f*****g divorce..).
from ale.
We'll keep working on it.
I'm sorry to hear about your personal problems! Good luck to you.
from ale.
Here is something we should keep in mind, which I just fixed, and I've gotten wrong myself. The order of the AssertEqual
arguments is expected, actual
, and not actual, expected
. Only one way produces the correct output when the assertion fails.
from ale.
I've been trying to get a test to execute a job with buffer input, and so far I haven't succeeded. If anyone finds a way to do that, let me know.
from ale.
I added an ID to the Makefile so running tests locally will pull a more recent Docker image if we update the ID in the Makefile. So for updating the image, we'll have to do the following.
- Update the Dockerfile in the repo, and push that to the master branch. Get the build to run again. (It should be automatic, but so far... it doesn't seem to be.)
- Pull the latest Docker image on a local machine, and get the ID for that image.
- Update the ID in the Makefile again, and push that to the repo.
If we follow those steps, then anyone who pulls the repo and runs make
again afterwards will run the tests with the most up to date image automatically.
from ale.
Why not just make the Make file run docker pull unconditionally?
from ale.
I do believe the purpose of the docker images -q was just to print the image version to the test output -- there is no reason not to pull every time.
from ale.
I believe that will mean running make
will always use your Internet connection.
from ale.
If you have the latest image it will just noop, and if you don't have internet it will just error and continue.
from ale.
Hmm, I'll have to try it with my Internet connection turned off later. As long as it runs quickly enough, I'll go with that.
from ale.
I tried running docker pull
with my Internet connection off, and the command fails. I could just ignore the error, but then that will cause other weird errors.
from ale.
I tried to find a way to test the cursor moving triggering the function, but I couldn't get it to work.
from ale.
I tried last night, but I had trouble testing anything around functions triggered from autocmd
events. I'll close this issue now, and open another asking for help.
from ale.
Related Issues (20)
- Support hurlfmt as fixer and linter
- Add support for include-what-you-use
- Add support for basedpyright
- rust ALEGoToDefinition does not trigger any action HOT 1
- ALE linting .tsx as .ts files when using Biome
- [Biome] Linter not usable
- Should/could ALE pass --no-fix argument to ruff when linting (to override project configuration)? HOT 5
- ALEHover text not appearing in floating preview HOT 1
- Cannot use ALE in MacVim when the file is opened via the right-click context menu or the File > Open dialog in MacVim HOT 2
- error loading shared lib: libicui18n.so.73 HOT 1
- json linting with jq doesn't report errors correctly
- On Windows 11, shell=pwsh/powershell continues breaking ALE lint HOT 1
- `write-good` plugin need make separate files that only have text
- cspell option “-c config.yaml” not work
- `sqlfluff` does not work in Neovim, throws an error when trying to lint an opened file HOT 1
- Signs cannot be customized HOT 5
- ALEFix with clangtidy not updating the buffer HOT 1
- clang++ command not getting correct include paths
- error highlights entire function
- Add support for pymarkdown
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 ale.