chore: Ensure copyright line is the first in the file (#19608)

The copyright checker was allowing files with code above the copyright
line in a few places, mainly as a result of IDEs ordering imports
improperly.

This makes the check more robust, and adds a whitelist of valid lines
that may appear before the copyright line.
This commit is contained in:
Matt Mastracci 2023-06-26 09:38:55 -06:00 committed by GitHub
parent 801b9ec62d
commit fa935e553a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 16 deletions

View file

@ -1,4 +1,3 @@
use super::MacroConfig;
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
use super::generator_state::GeneratorState;
use super::signature::Arg;
@ -6,6 +5,7 @@ use super::signature::NumericArg;
use super::signature::ParsedSignature;
use super::signature::RetVal;
use super::signature::Special;
use super::MacroConfig;
use super::V8MappingError;
use proc_macro2::TokenStream;
use quote::quote;