-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use updated API for svlint v0.8.0 #7
Conversation
There are currently no tests, but this does attempt a `cargo build`, which is sufficient to detect API breakage between svlint and svlint-plugin-sample.
Here's the full warning: ``` warning: `extern` fn uses type `dyn Rule`, which is not FFI-safe --> src/lib.rs:6:35 | 6 | pub extern "C" fn get_plugin() -> *mut dyn Rule { | ^^^^^^^^^^^^^ not FFI-safe | = note: trait objects have no C equivalent = note: `#[warn(improper_ctypes_definitions)]` on by default ``` This is expected because, as rustc notes, trait objects have no C equivalent, so should be ignored.
Preparation for updating the API to use both `TextRule` and `SyntaxRule`.
- Boilerplate should be replaced with updated version of `combine_rules`. This is just to try getting things working. - Tested with local build of svlint.
Thanks @skjdbg (dalance/svlint#253 (comment)) Also fix warning by using result of `linter.load()`.
As per dalance/svlint#253, this will be changed from draft to proper after svlint v0.8.0 is released. |
On my local version of svlint (where I had pulled some of your changes) the I'm recompiling to check with your last commits, but it take a very long time on this machine. I'll tell you if anything changes. |
@DaveMcEwan I tested with your last commits and I still have the error. It seems to only work properly if the regex "XXX" matches on the first line of the file. |
Does that mean |
All tests pass, yet when I call
Here is the console output
and the content of class driver extends uvm_driver#(seq_item); // XXX
//XXX
task run_phase (uvm_phase phase);
foobar.get_next_item(XXX);
// Test
foo <= bar; //XXX
foo <= bar;
baz <= XXX;
endtask
endclass : droiver
|
I think it's a matter of CRLF vs LF. I repeated your steps on a linux machine, but wrote |
Ok cool. I can reproduce that with Summary of issue: svlint reports wrong line numbers for From a quick look, it doesn't look trivial to fix! However, a fix shouldn't conflict with any of the open PRs. |
On another note, in let r = format!(r"XXX");
self.re = Some(Regex::new(&r).unwrap()); should be the same as this let r = r"XXX";
self.re = Some(Regex::new(r).unwrap()); |
You're right, I just copied from https://github.com/dalance/svlint/blob/master/src/textrules/header_copyright.rs for the example, but it isn't necessary. |
Well then I have no more issues. =) |
…kjdbg Discussed here: dalance/svlint-plugin-sample#7 (comment) Reproduction command: `SVLINT_CONFIG=doslinenum.toml cargo run -- forbidden_regex.sv` The message printed doesn't line up with the Notes: - This doesn't fit into the normal testcase structure because `build.rs` splits testcase files into subtests, which are always ff=unix. - `build.rs` depends on the normal testcase files existing, but they're empty in this commit. - Git can be configured to change line endings, so ensure that `./forbidden_regex.sv` has CRLF (DOS-format) line endings.
…kjdbg Discussed here: dalance/svlint-plugin-sample#7 (comment) Reproduction command: `SVLINT_CONFIG=doslinenum.toml cargo run -- forbidden_regex.sv` The output refers to wrong lines. Notes: - This doesn't fit into the normal testcase structure because `build.rs` splits testcase files into subtests, which are always ff=unix. - `build.rs` depends on the normal testcase files existing, but they're empty in this commit. - Git can be configured to change line endings, so ensure that `./forbidden_regex.sv` has CRLF (DOS-format) line endings.
@skjdbg I put a fix for the CRLF issue into the api branch of svlint. Would you mind checking that it's fixed for you too? |
It works on my side ! |
This PR can be merged either after or instead of Setup basic CI flow #6.
Thanks @skjdbg :)
Should not be merged until svlint v0.8.0 is released.DONEAfter that, another commit is required to this PR:
Cargo.toml
dependency on svlint should be "0.8", not the pin to a specific commit in my fork.