Skip to content

feat(zlinter): enable no_deprecated - #1117

Open
vesim987 wants to merge 1 commit into
mainfrom
zlinter-no-deprecated
Open

vesim987 wants to merge 1 commit into
mainfrom
zlinter-no-deprecated

Conversation

@vesim987

@vesim987 vesim987 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Stack created with GitHub Stacks CLI • Give Feedback 💬

@vesim987
vesim987 added this pull request to stack #1123 November 5, 2026 23:41
.input = if (input) |bytes| .fixed(bytes) else null,
.output = if (write_enabled)
std.array_list.Managed(u8).init(std.testing.allocator)
std.array_list.Managed(u8).init(std.testing.allocator) // zlinter-disable-current-line no_deprecated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to just .init here

const uart_regs = uart.get_regs();
const peri_freq = config.clock_config.peri.?.frequency();
uart.set_baudrate(config.baud_rate, peri_freq);
uart.set_baudrate(config.baud_rate, peri_freq); // zlinter-disable-current-line no_deprecated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is deprecated here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// Deprecated, use set_divider instead
pub fn set_baudrate(uart: UART, baud_rate: u32, peri_freq: u32) void {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, I guess that is how the linted figures a function is deprecated.

var sram = aviron.FixedSizeMemory(mcu_config.sram_size, .{ .address_type = u24 }){};

var stdout = std.array_list.Managed(u8).init(gpa);
var stdout = std.array_list.Managed(u8).init(gpa); // zlinter-disable-current-line no_deprecated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(See comment from other PR)

Comment thread tools/linter/src/main.zig
path: []const u8,
source: []const u8,
issues: *std.ArrayListUnmanaged(Issue),
issues: *std.ArrayListUnmanaged(Issue), // zlinter-disable-current-line no_deprecated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a normal arraylist now. We already pass allocator to append

Comment thread tools/regz/src/patch.zig
entries: std.array_list.Managed(Patch),
entries: std.array_list.Managed(Patch), // zlinter-disable-current-line no_deprecated

pub fn append(list: *PatchList, patch: Patch) void {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just add an allocator to the struct and pass it along to list.append?

Comment thread tools/parts_db.zig

var chips = std.array_list.Managed(MicroZig.Chip).init(allocator);
var boards = std.array_list.Managed(MicroZig.Board).init(allocator);
var chips: std.ArrayList(MicroZig.Chip) = .empty;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this even for?

Comment thread build.zig
}) catch @panic("OOM"),
};
} else if (target.cpu.arch.isRISCV() and target.ptrBitWidth() == 32) {
} else if (target.cpu.arch.isRiscv() and target.ptrBitWidth() == 32) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when did this change? How did this build?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        /// Deprecated; to be removed in 0.18.0. Use `isRiscv` instead.
        pub const isRISCV = isRiscv;

looks like during the 0.17.0 dev cycle

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird. I just didn't expect a case-change in a name to get a re-assign to support the deprecate.

Why isn't this caught?

https://github.com/ZigEmbeddedGroup/microzig/blob/main/core/src/utilities.zig#L775

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is using zls under the hood and zls doesn't work too well with microzig

Base automatically changed from zlinter-init to main November 7, 2026 14:33
@mattnite
mattnite force-pushed the zlinter-no-deprecated branch from 968d998 to 534e252 Compare November 7, 2026 14:33

@mattnite mattnite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the ignore comments for the linter and then this is good to go. I want them gone.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants