Skip to content
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

[bug] tauri::command breaks the #![deny(missing_docs)] directive #4550

Closed
will-hart opened this issue Jul 1, 2022 · 2 comments
Closed

[bug] tauri::command breaks the #![deny(missing_docs)] directive #4550

will-hart opened this issue Jul 1, 2022 · 2 comments
Labels
scope: core Core packages of Tauri type: bug

Comments

@will-hart
Copy link

will-hart commented Jul 1, 2022

Describe the bug

I am unable to include the #![deny(missing_docs)] directive in a tauri application that uses tauri commands.

Reproduction

  1. Create a new tauri app
  2. Add #![deny(missing_docs)] at the top of main.rs
  3. Create a command using #[derive(tauri::command)], with or without documentation

Expected behavior

The application compiles without errors.

Platform and versions

Environment
  › OS: Windows 10.0.19044 X64
  › Webview2: 103.0.1264.37
  › MSVC: 
      - Visual Studio Build Tools 2019
  › Node.js: 16.15.1
  › npm: 8.11.0
  › pnpm: Not installed!
  › yarn: 1.22.19       
  › rustup: 1.24.3
  › rustc: 1.61.0
  › cargo: 1.61.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0
  › @tauri-apps/api [NPM]: 1.0.1
  › tauri [RUST]: 1.0.0,
  › tauri-build [RUST]: 1.0.0,
  › tao [RUST]: 0.11.2,
  › wry [RUST]: 0.18.3,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:3000/
  › framework: React

App directory structure
  ├─ .git
  ├─ .github
  ├─ .storybook
  ├─ .vscode
  ├─ dist
  ├─ lib
  ├─ node_modules
  ├─ schema
  ├─ src
  └─ src-tauri

Stack trace

error: missing documentation for a macro                      
  --> src\commands.rs:14:1
   |
14 | #[tauri::command]
   | ^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src\main.rs:5:9
   |
5  | #![deny(missing_docs)] //<- tauri commands break this    
   |         ^^^^^^^^^^^^
   = note: this error originates in the attribute macro `tauri::command` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `app` due to previous error

Additional context

This is a known limitation that requires support from the macro to resolve.

@will-hart will-hart changed the title [bug] tauri::command breaks the #![deny(missing_docs)]] directive [bug] tauri::command breaks the #![deny(missing_docs)] directive Jul 1, 2022
@amrbashir amrbashir added the scope: core Core packages of Tauri label Jul 1, 2022
@lucasfernog
Copy link
Member

Fix will be available in the next release. For now you can add #![allow(missing_docs)] to the src/commands.rs file.

@will-hart
Copy link
Author

Awesome, thanks! I love what you're doing with tauri 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core Core packages of Tauri type: bug
Projects
None yet
Development

No branches or pull requests

3 participants