Project naming verification method and device

By determining naming verification rules based on project type, path type, and root directory type, the flexibility and accuracy issues of naming verification between different projects are solved, improving naming consistency and team efficiency.

CN120687415APending Publication Date: 2025-09-23MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510058494.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Existing technologies cannot meet the personalized naming verification requirements between different projects, resulting in a lack of flexibility and precision in naming rules, which affects team work efficiency.

Method used

Determine personalized naming verification rules based on project type, project path type and project root directory type, and implement personalized verification of project names by obtaining and matching naming verification rules.

Benefits of technology

It improves the flexibility and accuracy of naming verification, enhances the naming consistency of the file system, and improves the work efficiency of the team.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687415A_ABST
    Figure CN120687415A_ABST
Patent Text Reader

Abstract

The invention provides a project naming verification method and device, and the method comprises the steps: obtaining the name of a to-be-verified project and a plurality of first naming verification rules, and each first naming verification rule in the plurality of first naming verification rules is used for verifying the name of a type of project corresponding to each first naming verification rule; at least one second naming verification rule is determined from the multiple first naming verification rules, and the type corresponding to the second naming verification rule is matched with at least one of the item type, the item path type and the item root directory type corresponding to the item to be verified; determining a third naming verification rule corresponding to the to-be-verified item according to the at least one second naming verification rule; and performing naming verification on the name of the to-be-verified item according to a third naming verification rule to obtain a verification result. In this way, personalized naming verification requirements among different items can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the general field of data processing technology, and in particular to a project naming verification method and device. Background Art

[0002] Project naming is an essential part of front-end development. Due to differences between teams, project naming rules often vary. However, current naming verification methods for projects within a single file system use a unified standard, which cannot meet the personalized naming verification requirements of different projects. Summary of the Invention

[0003] The present application provides a project naming verification method and device, which determines the third naming verification rule corresponding to the project to be verified based on the project type, project path type and project root directory type corresponding to the project to be verified, so as to perform naming verification on the name of the project to be verified according to the third naming verification rule, which can meet the personalized naming verification requirements between different projects.

[0004] In a first aspect, the present application provides a project naming verification method, the method comprising:

[0005] Obtain the name of the project to be verified and multiple first naming verification rules, each of the multiple first naming verification rules is used to verify the name of the project of the type corresponding to each first naming verification rule, the multiple first naming verification rules correspond to at least one target project level, and the at least one target project level is a project level between the root directory and the project to be verified under the project path corresponding to the project to be verified;

[0006] Determining at least one second naming verification rule from the plurality of first naming verification rules, wherein a type corresponding to the second naming verification rule matches at least one of a project type, a project path type, and a project root directory type corresponding to the project to be verified, wherein the project path type is used to indicate a type of a first project included in the project path corresponding to the project to be verified, wherein the first project is a project in the project path excluding the project to be verified and the project root directory;

[0007] Determining a third naming verification rule corresponding to the item to be verified according to at least one second naming verification rule;

[0008] The name of the item to be verified is verified according to the third naming verification rule to obtain a verification result.

[0009] It can be seen that in this application, according to the project type, project path type and project root directory type corresponding to the project to be verified, the corresponding third naming verification rule is determined from multiple first naming verification rules, and the name of the project to be verified is named and verified according to the third naming verification rule. In this way, for different projects, a naming verification rule that matches the project type, project path type and project root directory type corresponding to each project can be determined. Based on the differences in the corresponding project types, project path types and project root directory types between different projects, different projects can obtain the naming verification rules corresponding to each project, thereby meeting the personalized naming verification requirements between different projects.

[0010] At the same time, since the naming verification rules of each project are determined according to the project type, project path type and project root directory type corresponding to each project, the naming verification rules of each project can be determined to have higher flexibility and accuracy compared to determining the naming verification rules of each project only according to the project type of each project. The second naming verification rules determined by the above three types are all matched and determined from at least one first naming verification rule set on the project level corresponding to the above three types. Since the project types under different project levels may have corresponding different naming rules, the accuracy of the naming verification can be further improved by pre-setting the corresponding first naming verification rules based on each level. At the same time, compared to directly determining the second naming verification rules based on all pre-set naming verification rules, the efficiency of determining the second naming verification rules is improved. In addition, the project root directory and project path are associated with the file system corresponding to each project. Determining the naming verification rules corresponding to each project based on the project root directory type and project path type can improve the naming consistency of the entire file system, thereby improving the work efficiency of the team corresponding to the project.

[0011] In a second aspect, the present application provides a project naming verification device, which includes:

[0012] an acquisition unit, configured to acquire a name of a project to be verified and a plurality of first naming verification rules, wherein each of the plurality of first naming verification rules is configured to verify a name of a project of a type corresponding to each first naming verification rule, and wherein the plurality of first naming verification rules correspond to at least one target project level, and the at least one target project level is a project level between a root directory and the project to be verified under a project path corresponding to the project to be verified;

[0013] a processing unit, configured to determine at least one second naming verification rule from a plurality of first naming verification rules, wherein a type corresponding to the second naming verification rule matches at least one of a project type, a project path type, and a project root directory type corresponding to the project to be verified, wherein the project path type is used to indicate a type of a first project included in the project path corresponding to the project to be verified, the first project being a project in the project path excluding the project to be verified and the project root directory;

[0014] The processing unit is further configured to determine a third naming verification rule corresponding to the item to be verified based on the at least one second naming verification rule;

[0015] The processing unit is further configured to perform a name verification on the name of the item to be verified according to a third name verification rule to obtain a verification result.

[0016] In a third aspect, the present application provides an electronic device comprising a processor, a memory, and a communication interface. The processor, memory, and communication interface are interconnected and perform communication with each other. The memory stores executable program code, the communication interface is used for wireless communication, and the processor is used to retrieve the executable program code stored in the memory and execute some or all of the steps described in any method of the first aspect.

[0017] In a fourth aspect, the present application provides a computer-readable storage medium, in which electronic data is stored. When the electronic data is executed by a processor, the electronic data is used to execute the electronic data to implement some or all of the steps described in the first aspect of the present application.

[0018] In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the present application. The computer program product may be a software installation package. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 A schematic diagram of the structure of a project naming verification system provided in an embodiment of the present application;

[0021] Figure 2A schematic diagram of the structure of a file system provided in an embodiment of the present application;

[0022] Figure 3 A flowchart of a project naming verification method provided in an embodiment of the present application;

[0023] Figure 4 A flowchart of a method for determining naming verification rules provided in an embodiment of the present application;

[0024] Figure 5 A flowchart of another project naming verification method provided in an embodiment of the present application;

[0025] Figure 6 A block diagram of the functional units of a project naming verification device provided in an embodiment of the present application;

[0026] Figure 7 A block diagram of the functional units of another project naming verification device provided in an embodiment of the present application;

[0027] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] The terms "first," "second," and so on, in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps is not limited to the listed steps but may optionally include steps not listed, or may optionally include other steps inherent to the process, method, product, or apparatus.

[0030] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] See also Figure 1 , Figure 1 A schematic diagram of the structure of a project naming verification system provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the project naming verification system includes a client device 101 and a server 102 .

[0032] Optionally, the client device 101 may be a terminal device, such as a desktop computer, a laptop computer, a tablet computer, a smart phone, etc. The server 102 may be a server, a server cluster, a cloud server, a cloud computing service center, or other forms of devices with computing capabilities.

[0033] The project naming verification can refer to the names of projects at different levels in the file system. The file system can be a file system stored in the client device 101, and the execution subject of the project naming verification can be the server 102, or it can also be the client device 101 itself. When the execution subject of the project naming verification is the server 102, the server 102 obtains the name of the project to be verified in the client device 101 and multiple first naming verification rules, and determines at least one second naming verification rule that matches the project type, project path type and project root directory type corresponding to the project to be verified based on the type corresponding to each first naming verification rule. Finally, the third naming verification rule corresponding to the project to be verified is determined based on the at least one second naming verification rule, and then the name of the project to be verified is named and verified according to the third naming verification rule to obtain the verification result. In addition, the multiple first naming verification rules correspond to at least one target project level, and the at least one target project level is the project level between the root directory and the project to be verified under the project path corresponding to the project to be verified.

[0034] In this way, for different projects, the naming verification rules corresponding to each project can be determined respectively, thereby meeting the personalized naming verification requirements between different projects. At the same time, since the naming verification rules for each project are determined according to the project type, project path type and project root directory type corresponding to each project, compared to determining the naming verification rules for each project only according to the project type of each project, the naming verification rules for each project can be determined to have higher flexibility and accuracy, and the project root directory and project path are associated with the file system corresponding to each project. Determining the naming verification rules corresponding to each project according to the project root directory type and project path type can improve the naming consistency of the entire file system, thereby improving the work efficiency of the team corresponding to the project.

[0035] See also Figure 2 , Figure 2 A schematic diagram of the structure of a file system provided in an embodiment of the present application is shown in FIG. Figure 2As shown, the file system includes a project root directory and multiple levels of different projects under the project root directory, and the project includes files and directories.

[0036] The next level of the project root directory includes multiple projects such as Project A and Project B, and the next level of Project A includes multiple projects such as Project a1 and Project a2. The next level of Project B includes multiple projects such as Project b1 and Project b2, and so on. The project to be verified shown in this application can be any project under the file system, and can also include a project root directory. The project root directory refers to the top-level directory in the file system, and the project path corresponding to the project to be verified refers to the path starting from the project root directory and pointing to the project to be verified step by step. For example, if the project to be verified is Project a1, then the project path corresponding to Project a1 is Project root directory > Project A > Project a1, and the project path type corresponding to Project a1 is the same as that of Project A.

[0037] Based on this, an embodiment of the present application provides a project naming verification method, which is described in detail below with reference to the accompanying drawings.

[0038] See also Figure 3 , Figure 3 A flowchart of a project naming verification method provided in an embodiment of the present application is provided, and the method is applied to a client device or a server, such as Figure 3 As shown, the method includes the following steps:

[0039] Step S301: Obtain the name of the item to be verified and a plurality of first naming verification rules.

[0040] Among them, each first naming verification rule in the multiple first naming verification rules is used to verify the name of the project of the type corresponding to each first naming verification rule. The multiple first naming verification rules can be commonly used rules with universal applicability, or they can be user-defined rules for specific projects. The multiple first naming verification rules can be predetermined rules stored in. For example, commonly used rules may include lower camel case naming (LOWER_CAMEL_CASE), upper camel case naming (UPPER_CAMEL_CASE), all uppercase letters with underscores (UPPER_CASE_WITH_UNDERSCORES), lowercase with hyphens (KEBAB_CASE), etc.; user-defined rules may be that when the project type is a hooks hook project, the name of the test project needs to start with use.

[0041] At the same time, each project level included in the project path corresponding to the project to be verified has a pre-set naming verification rule, and the naming verification rules are all set based on the naming formats that may exist under each project level. The multiple first naming verification rules are pre-set naming verification rules corresponding to at least one target project level, and the at least one target project level is the project level between the root directory and the project to be verified under the project path corresponding to the project to be verified. In addition, it can be understood that under the aforementioned project path, the lower the project level, the more types of pre-set naming verification rules corresponding to the project level. This is because the lower the project level, the more types of projects there are, and each project may be assigned to more objects for processing, resulting in more reported project naming formats. More naming verification rules need to be pre-set for the project level, so that richer naming verification requirements can be met later.

[0042] In a specific embodiment, a naming specification selector may be implemented for multiple first naming verification rules, that is, an enumeration may be selected and defined to facilitate subsequent combination of multiple first naming verification rules.

[0043] Each of the multiple first naming verification rules is used to verify the name of a project of the type corresponding to each first naming verification rule, and the type corresponding to each naming verification rule is not unique. For example, the name of a js (JavaScript) type project or an image type project can correspond to the aforementioned lower camel case naming method; the name of a css (Cascading Style Sheets) type project can correspond to the aforementioned upper camel case naming method; the name of a utils type project can correspond to the aforementioned lower case plus a hyphen; and the name of a constant type project can correspond to the aforementioned all-capital letters plus an underscore.

[0044] Step S302: Determine at least one second naming verification rule from the plurality of first naming verification rules.

[0045] Among them, the type corresponding to the second naming verification rule matches at least one of the project type, project path type and project root directory type corresponding to the project to be verified. The project path type is used to represent the type of the first project included in the project path corresponding to the project to be verified. The first project is the project included in the project path except the project to be verified and the project root directory.

[0046] The project path refers to the path starting from the project root directory and pointing to the project to be verified step by step. It is understandable that the project path type can include multiple project types. At the same time, the project type, project path type, and project root directory type shown in this application can be determined based on the name of the project to be verified, the name of the first project included in the project path, and the name of the project root directory, respectively.

[0047] Projects include files and directories, and directories can also refer to folders. When a project includes files, the corresponding project type, project path type, and project root directory type are file type, file path type, and project root directory type; when a project includes directories, the corresponding project type, project path type, and project root directory type are directory type, directory path type, and project root directory type. The third naming verification rule corresponding to each project is determined based on the project type, project path type, and project root directory type corresponding to each project, so that differentiated rules are implemented for specific files or directories in the file system. For example, a set of exclusive naming verification rules is set for the routing components under the pages directory, and another set of exclusive naming verification rules is applied to the business components in the components directory.

[0048] When determining at least one second naming verification rule, it is necessary to match the types corresponding to the multiple second naming rules with the project type, project path type, and project root directory type corresponding to the project to be verified, respectively, to obtain at least one second naming verification rule corresponding to a type that successfully matches the types corresponding to the multiple second naming rules with at least one of the project type, project path type, and project root directory type corresponding to the project to be verified. Subsequently, a third naming verification rule is determined based on the at least one second naming verification rule. The third naming verification rule can be single or multiple.

[0049] It is understood that in addition to determining the third naming verification rule corresponding to the project to be verified, the file system corresponding to the project to be verified can also include a default rule, but this default rule is prioritized at the end. Only when a project does not have a specific third naming verification rule, the project name can be verified according to the default rule. In this way, even if the verification method is not explicitly specified, all project files can still obtain a unified and basic quality assurance, realizing the comprehensiveness and flexibility of the verification mechanism.

[0050] The following is a detailed description of the current step:

[0051] Furthermore, in a feasible embodiment, if at least one second naming verification rule is single, determining at least one second naming verification rule from multiple first naming verification rules includes: determining the matching order of multiple first naming verification rules, and determining the first type with the highest priority among the project type, project path type, and project root directory type corresponding to the project to be verified; matching the types corresponding to the multiple first naming verification rules with the first type according to the matching order of the multiple first naming verification rules, until there is a second type among the types corresponding to the multiple first naming verification rules that successfully matches the first type, and determining that the naming verification rule corresponding to the second type is the second naming verification rule.

[0052] Among them, the matching order of multiple first naming verification rules can be determined according to the scope of application of each naming verification rule, that is, the larger the scope of application, the later the matching order of the naming verification rule. Exemplarily, the scope of application of each naming verification rule can be determined according to the number of types corresponding to each naming verification rule, or the number of items of the corresponding type in the file system. For example, the scope of application of a specific naming verification rule formulated by the user for a specific type of file is smaller than the scope of application of the commonly used rules. This is because the smaller the scope of application, the stronger the targeting between the naming verification rule and the name of the item to be verified. It can be understood that for the matching order of multiple first naming verification rules, users can also make different customized settings according to different scenarios.

[0053] The priority of each type of project type, project path type and project root directory type corresponding to the project to be verified can be determined according to the hierarchy of the project corresponding to each type. If the hierarchy of the project corresponding to a certain type is closer to the hierarchy corresponding to the project to be verified, the priority of the type is higher. For example, the priority of the project type corresponding to the project to be verified is the highest, and the priority of the project root directory type is the lowest. This is because if the hierarchy of the project corresponding to a certain type is closer to the hierarchy of the project to be verified itself, the correlation between the project corresponding to the type and the project to be verified will be higher, and then the naming verification rules determined according to the type will be more targeted. It can be understood that for the priority of each type of project type, project path type and project root directory type corresponding to the project to be verified, users can also make different customized settings according to different scenarios.

[0054] Based on the matching order of the multiple first naming verification rules, the types corresponding to the multiple first naming verification rules are matched with the first type until a second type successfully matches the first type among the types corresponding to the multiple first naming verification rules. Then, the naming verification rule corresponding to the second type is determined to be the second naming verification rule, and matching stops. That is, at this point, only a single second naming verification rule exists for the item to be verified. Simultaneously, determining a third naming verification rule based on at least one second naming verification rule includes: determining the second naming verification rule as the third naming verification rule.

[0055] In the present application, a matching order is set for multiple first naming verification rules, and the first type with the highest priority among the project type, project path type and project root directory type corresponding to the project to be verified is matched with the type corresponding to each of the aforementioned first naming verification rules. This allows priority matching of naming verification rules that are more targeted to the project to be verified.

[0056] In supplement to the foregoing embodiment, in a feasible embodiment, the method further includes: when there is no second type that successfully matches the first type among the types corresponding to the multiple first naming verification rules, determining a third type with a lower priority than the first type among the project type, project path type, and project root directory type corresponding to the project to be verified; matching the types corresponding to the multiple first naming verification rules with the third type according to the matching order of the multiple first naming verification rules until there is a fourth type that successfully matches the third type among the types corresponding to the multiple first naming verification rules, and determining that the naming verification rule corresponding to the fourth type is the second naming verification rule.

[0057] Among them, if there is no second type that successfully matches the first type among the types corresponding to the multiple first naming verification rules, then in order to further ensure that the naming verification rule corresponding to the project to be verified can be determined, it is necessary to determine a third type with a lower priority than the first type from the project type, project path type and project root directory type corresponding to the project to be verified, and then re-match the types corresponding to the multiple first naming verification rules with the third type according to the matching order of the multiple first naming verification rules, until there is a fourth type that successfully matches the third type among the types corresponding to the multiple first naming verification rules, determine that the naming verification rule corresponding to the fourth type is the second naming verification rule, and stop matching. At the same time, since there is only a single second naming verification rule corresponding to the project to be verified at this time, the second naming verification rule can be directly determined as the third naming verification rule.

[0058] It is understandable that the third type is a type that has a lower priority than the first type among the project type, project path type, and project root directory type corresponding to the project to be verified. In this case, the third type can be a type that is only lower than the first type, or a type that is not only lower than the first type. For example, if the types corresponding to the project to be verified include type 1, type 2, and type 3, type 1 has a higher priority than type 2, and type 2 has a higher priority than type 3, if type 1 is the first type, then the third type can be type 2 or type 3.

[0059] In the present application, when there is no second type that successfully matches the first type among the types corresponding to multiple first naming verification rules, re-matching is performed according to the third type with a lower priority than the first type. This can further ensure that the naming verification rule corresponding to the item to be verified can be determined.

[0060] In addition, for a single naming verification rule, the naming verification rule that meets the project type can also be directly matched according to the project type of the project to be verified.

[0061] Step S303: Determine a third naming verification rule corresponding to the item to be verified according to the at least one second naming verification rule.

[0062] Furthermore, the following describes in detail how to determine the third naming verification rule based on the at least one second naming verification rule when there are multiple at least one second naming verification rules:

[0063] In a feasible embodiment, if there are multiple at least one second naming verification rules, the third naming verification rule corresponding to the project to be verified is determined according to the at least one second naming verification rule, including: if it is determined that there are conflicting fourth naming verification rules and fifth naming verification rules among the multiple second naming verification rules, then determine the fifth type and sixth type corresponding to the fourth naming verification rule and the fifth naming verification rule respectively among the project types, project path types and project root directory types corresponding to the project to be verified; determine the seventh type from the fifth type and the sixth type, the seventh type being the type with the farthest distance between the project levels corresponding to the fifth type and the sixth type and the project level corresponding to the project to be verified; exclude the naming verification rule corresponding to the seventh type from the multiple second naming verification rules to obtain the third naming verification rule.

[0064] When there are multiple second naming verification rules, in order to ensure that the multiple second naming verification rules can be applied to the items to be verified simultaneously, it is necessary to determine whether there are two conflicting rules among the multiple second naming verification rules. The conflicting rules may be two rules that cannot be implemented simultaneously. For example, the aforementioned rules of all uppercase letters plus underscores and lowercase letters plus hyphens conflict with each other.

[0065] If it is determined that there are conflicting fourth and fifth naming verification rules among the multiple second naming verification rules, it is necessary to eliminate a single naming verification rule from the fourth and fifth naming verification rules. Specifically, determine the fifth type and sixth type corresponding to the fourth and fifth naming verification rules respectively. It can be understood that the fifth type and the sixth type are types in the project type, project path type, and project root directory type corresponding to the project to be verified. Then, the project levels corresponding to the fifth type and the sixth type can be determined, and the seventh type with the farthest distance between the project level corresponding to the fifth type and the sixth type and the project level corresponding to the project to be verified can be determined. Then, the naming verification rule corresponding to the seventh type is excluded from the multiple second naming verification rules to obtain the third naming verification rule.

[0066] It is understandable that if it is determined that there are no conflicting fourth and fifth naming verification rules among the multiple second naming verification rules, the multiple second naming verification rules can be directly determined as the third naming verification rule. The third naming verification rule can be directly represented by the multiple second naming verification rules, or expressed by a single expression including the multiple second naming verification rules.

[0067] In the present application, when there are multiple second naming verification rules, eliminating a single rule from two conflicting rules among the multiple second naming verification rules can avoid the inability of multiple second naming verification rules to be applied at the same time, thereby further improving the accuracy of determining the third naming verification rule.

[0068] For example, see Figure 4 , Figure 4 A flowchart of a method for determining a naming verification rule provided in an embodiment of the present application is shown as follows: Figure 4 As shown, after determining the project to be verified, determine the project path corresponding to the project to be verified, that is, project root directory > secondary project > project to be verified. When the project root directory is determined to be a picture type based on the name of the project root directory (topFolderName), it can be determined that its corresponding naming verification rule is lower camel case naming (return LOWER_CAMEL_CASE); when the secondary project is determined to be a tool type based on the name of the secondary project (currentFolderNmme), it can be determined that its corresponding naming verification rule is lower case with a hyphen (return KEBAB_CASE); when the name of the project to be verified is determined to include the word "test" and its type is a test type, it can be determined that its corresponding naming verification rule is to start with "test". Based on this, the above three naming verification rules can be determined.

[0069] Step S304: Perform name verification on the name of the item to be verified according to the third name verification rule to obtain a verification result.

[0070] Among them, the verification result may include correct naming or wrong naming. The naming verification for the project to be verified can be a naming verification after a single project is generated, or it can be a naming verification for the projects to be verified in multiple projects or the projects to be verified in the entire file system after multiple projects or the entire file system are generated. If the naming verification is performed for the projects to be verified in the entire file system, it can be started from the current working project (for example, it can be obtained through the node process module process.cwd()), and the root path can be identified (for example, it can be implemented using path.parse(currentPath).root, or the node template file path method path), and then the projects that do not need to be verified in the file system corresponding to the entire root path can be excluded according to the verification exclusion rules, thereby obtaining a set of projects that need to be verified in the file system. When the naming verification is performed on the projects to be verified in the project set, the projects in the project set can be recursively traversed, and each time a project is encountered, the naming verification is performed according to the aforementioned method.

[0071] Name validation is typically performed using regular expressions, but these expressions rely on fixed character classes or explicitly specified character ranges, and are typically limited to the ASCII character set (i.e., the English letters az and AZ). This lacks flexibility when working with different languages ​​or scripts. Furthermore, when processing internationalized text, regular expressions may miss certain characters or misjudge character classes, leading to inaccurate validation results.

[0072] Based on this, the present application performs naming verification on the name of the verification item according to the third naming verification rule, which is mainly based on the Unicode mode, as described in detail below:

[0073] In a feasible embodiment, the name of the item to be checked is checked according to a third naming check rule to obtain a check result, including: checking the name of the item to be checked according to a preset character rule, the preset character rule including that the input name is not empty, the input name is in a string format, and the string length of the input name is not zero; if it is determined that the preset character rule check passes, then determining the Unicode expression of the target character type corresponding to the third naming check rule; matching each character in the name of the item to be checked according to the Unicode expression of the target character type, thereby determining the target character in the name of the item to be checked, and the type of the target character is the target character type; if it is determined that the target character in the name of the item to be checked complies with the third naming check rule, then obtaining a first check result; if it is determined that the target character in the name of the item to be checked does not comply with the third naming check rule, then obtaining a second check result, and the check result includes a first check result and a second check result, the first check result being that the naming is correct, and the second check result being that the naming is incorrect.

[0074] By enabling Unicode mode and using Unicode property escapes, you can process characters in the entire Unicode character set, including but not limited to Latin, Cyrillic, Greek, Asian characters, etc. For example, \p{L} represents any type of alphabetic character, \p{Lu} represents uppercase letters, and \p{Ll} represents lowercase letters, which makes rules more general and easier to write.

[0075] Specifically, the name of the item to be checked is first tested against the preset character rules. The preset character rule test mainly performs input validity testing on the input name. If the test passes, the Unicode expression of the target character type corresponding to the third naming verification rule is determined. The target character type corresponding to the third naming verification rule can be understood as the type of character that needs to be verified by the third naming verification rule. Subsequently, each character in the name of the item to be checked is matched based on the Unicode expression of the target character type, the target character in the name of the item to be checked is determined, and finally, it is determined whether the target character complies with the third naming verification rule.

[0076] For example, for the implementation of naming verification for the camel case naming method, first, an input check is performed, that is, the name of the item to be verified is checked according to the preset character rules. The preset character rules include that the input name is not empty, the input name is in string format, and the string length of the input name is not zero. Secondly, the Unicode expression of the target character type corresponding to the camel case naming method is determined, for example, the Unicode expression for the Latin script is \p{Script=Latin}, the Unicode expression for lowercase letters is \p{Ll}, and the Unicode expression for uppercase letters is \p{Lu}. Subsequently, each character in the name of the item to be verified is looped through, and a match is performed according to the aforementioned Unicode expression for the Latin script, the Unicode expression for lowercase letters, and the Unicode expression for uppercase letters, to determine the uppercase and lowercase letters of each Latin script in the name of the item to be verified. Finally, based on the uppercase and lowercase distribution in the name of the item to be verified, it is determined whether the camel case naming method is met, that is, the first character is determined to be a lowercase letter, and the uppercase letter in the subsequent characters must be followed by a lowercase letter.

[0077] For another example, for the implementation of naming verification for all uppercase letters and underlines, first, an input check is performed, that is, the name of the item to be verified is also tested with preset character rules, and the preset character rules include that the input name is not empty, the input name is in string format, and the string length of the input name is not zero. Secondly, the Unicode expression of the target character type corresponding to all uppercase letters and underlines is determined, for example, the Unicode expression for uppercase letters of the Latin script is latinUppercaseLetterRegex, and the Unicode expression for underscore is underscoreRegex. Subsequently, each character in the name of the item to be verified is looped through, and character matching is performed based on the Unicode expression of uppercase letters of the Latin script and the Unicode expression of underscore, to determine the uppercase letters and underscores of each Latin script in the name of the item to be verified. Finally, based on the distribution of uppercase letters and underscores in the name of the item to be verified, it is determined whether it meets the requirements of all uppercase letters and underscores, that is, continuous underscores and characters starting or ending with underscores are not allowed, and at the same time, except for underscores, all other characters must be uppercase letters.

[0078] In this application, since the job objects of projects at different levels in the file system are different, the project naming language or format will be different. Naming verification through Unicode mode can adapt to different naming languages ​​or formats, thereby improving the flexibility and accuracy of naming verification.

[0079] In a feasible embodiment, the method also includes: determining whether the item to be verified is an item corresponding to a verification exclusion rule, where the verification exclusion rule is used to exclude items that do not require naming verification; if it is determined that the item to be verified is not an item corresponding to the verification exclusion rule, then executing the step of performing naming verification on the name of the item to be verified according to a third naming verification rule.

[0080] Among them, before obtaining the name of the project to be verified, or before performing name verification on the name of the project to be verified according to the third naming verification rule, it is necessary to determine whether the project to be verified is a project that requires name verification. This is because in a complex front-end project environment, the code base not only contains core business logic and interface components, but may also be mixed with third-party libraries, build configuration files and various metadata. These non-business code files often do not have to go through a strict code inspection process. Therefore, the verification exclusion rules can be used to avoid projects that do not require name verification, while improving the efficiency of naming verification for projects in the entire system.

[0081] The verification exclusion rule is used to exclude items that do not require naming verification. The verification exclusion rule can be preset by the user based on the file system itself. When it is determined that the item to be verified is not an item corresponding to the verification exclusion rule, it can be determined that the item to be verified is an item that requires naming verification. If the current step is performed before obtaining the name of the item to be verified, then when it is determined that the item to be verified is an item that requires naming verification, the step of obtaining the name of the item to be verified can be executed; if the current step is performed before performing a naming verification on the name of the item to be verified according to the third naming verification rule, then when it is determined that the item to be verified is an item that requires naming verification, the step of performing a naming verification on the name of the item to be verified according to the third naming verification rule can be executed.

[0082] In the present application, whether the item to be verified is an item that requires naming verification is determined according to the verification exclusion rules, and after determining that the item to be verified is an item that requires naming verification, subsequent naming verification operations are performed on the name of the item to be verified. This can avoid naming verification on items that do not require naming verification, thereby improving the efficiency of naming verification for projects in the entire system.

[0083] In a feasible embodiment, after performing a naming verification on the name of the item to be verified according to the third naming verification rule and obtaining the verification result, the method also includes: if it is determined that the verification result includes a naming error, generating a copy of the item to be verified corresponding to the item to be verified; according to the third naming verification rule, performing a naming repair on the name of the copy of the item to be verified to obtain a repaired copy of the item to be verified.

[0084] If the verification result is determined to be a naming error, the name of the item to be verified can be repaired. Before performing the naming repair, the source file (the item to be verified) can be retained, and a new file (a copy of the item to be verified) at the same level can be provided. Then, according to the third naming verification rule corresponding to the item to be verified, the name of the copy of the item to be verified can be repaired.

[0085] Exemplarily, for the aforementioned lower camelCase naming method, the naming repair step may include: 1. extracting English letters and numbers from the file name; 2. converting the extracted words to lowercase, for example, you can use JavaScript's native method toLowerCase to convert the extracted words, such as a@@@#$%^&*()Bc_+.less will extract two characters a and Bc, and you need to use lowercase conversion for a and Bc respectively; 3. The new file name will lose all characters except English letters and numbers compared to the original file name (such as the original name: a@@@#$%^&*()Bc_+.less, the repaired name: abc.less).

[0086] For the upper camelCase naming method, the naming repair steps may include: 1. Extracting English letters and numbers from the file name; 2. Capitalizing the first letters of the extracted words. For example, you can use JavaScript's native method toUpperCase to convert the extracted words. For example, test@@@#$%^&*()_+file.less will extract two characters, test and file, which need to be capitalized separately; 3. The new file name will lose all characters except English letters and numbers compared to the original file name (for example, the original name: test@@@#$%^&*()_+file.less, the repaired name: TestTile.less).

[0087] For all uppercase letters with underscores, the naming repair steps may include: 1. Extracting English letters from the file name; 2. Converting the extracted words to uppercase, for example, using JavaScript's native method toUpperCase to convert the extracted words; 3. Using _ to connect the converted words; 4. The new file name will lose all characters except English letters and numbers compared to the original file name (such as the original name: testfile@@@#$%^&*()_+.less, the repaired name: TEST_TILE.less).

[0088] For lowercase letters with hyphens, the naming repair steps may include: 1. Extracting English letters from the file name; 2. Converting the extracted words to lowercase, for example, using JavaScript's native method toLowerCase to convert the extracted words; 3. Connecting the converted words with -; 4. The new file name will lose all characters except English letters and numbers compared to the original file name (such as the original name: testfile@@@#$%^&*()_+.less, the repaired name: test-tile.less).

[0089] The repair methods summarized for the above methods include: 1. Extracting English letters from the file; 2. For each matched letter, you can perform cutting and conversion operations, such as cutting the string at each matching position, removing the "-" symbol, and according to the rules, if it is converted to uppercase, use the toUpperCase() method; if it is converted to lowercase, use the toLowerCase() method to process the just matched letter; 3. Reorganize the string after the cutting and conversion operations, such as re-splicing the case-converted letters to the corresponding positions of the original string, removing the original "-", and finally obtaining a string that conforms to the new naming rules.

[0090] At the same time, if the name repair fails when repairing the name of the copy of the verified project according to the third naming verification rule, the user can be guided to intervene through prompts to deal with complex situations that require more detailed manual judgment, ensuring that each repair is accurate.

[0091] In the present application, when performing naming repair, after generating a copy corresponding to the item to be verified, the copy is named and repaired according to the third naming verification rule corresponding to the item to be verified. In this way, the naming repair according to the third naming verification rule is more targeted, and the naming repair of the copy can also avoid the failure of the repair and the loss of the original file, thereby improving the fault tolerance rate of the naming repair of the name of the item to be verified.

[0092] In addition, in a feasible embodiment, after performing naming verification on the name of the item to be verified according to the third naming verification rule and obtaining the verification result, the method also includes: if it is determined that the verification result includes a naming error, determining the project importance corresponding to the item to be verified; generating a log file corresponding to the project importance according to the name corresponding to the item to be verified, the third naming verification rule, the generation rule of the third naming verification rule, and the automatic repair status of the item to be verified, the automatic repair status of the item to be verified includes whether the name corresponding to the item to be verified is repaired based on the third naming verification rule.

[0093] The importance of the items to be verified can be customized by the user according to the actual situation. For example, it can be determined based on the number of items corresponding to the current level of the items to be verified, or based on the number of items included in the next level of the items to be verified. The more items there are, the higher the importance of the items to be verified. At the same time, the importance of the items can also be determined by the importance level of the naming verification rules corresponding to the items. For example, the importance of the log files generated in this way can include three levels from low to high: info, warn, and error.

[0094] The output content and output format corresponding to the log file can be customized by the user. In addition to including the name of the project to be verified, the third naming verification rule, the generation rule of the third naming verification rule, and the automatic repair status of the project to be verified, it can also include the project type, project path type, project root directory type, and the project importance of the project to be verified. The generation rule of the third naming verification rule can include which type of the project type, project path type, and project root directory type corresponding to the project to be verified the type corresponding to the third naming verification rule belongs to, so that the source of the naming verification rule can be clearly known. Including the automatic repair status of the project to be verified in the log file can also let the user know in time whether the naming format of the project to be verified needs to be manually repaired.

[0095] The differences in log files corresponding to different project importances can be reflected in both the log file content and the log file prompts. For example, an important log file may include all of the aforementioned content, with a more prominent prompt, such as "Warning: Project 'xxx' (project type y1, project path type y2, project root directory type y3) does not comply with rule zzz (corresponding to project root directory type y3). Please check immediately!!!"; an unimportant log file may only include some of the aforementioned content, with a less prominent prompt, such as "Warning: Project 'xxx' (project type y1) does not comply with rule zzz."

[0096] Furthermore, the generated log file can be stored in a specific output file path, ensuring the traceability and convenience of the inspection results. It not only provides instant feedback on project naming verification non-compliance information in the command line interface, but also records and exports these details to a user-defined file path. This way, even after the inspection operation is completed, users can still easily check which files or directories do not comply with the corresponding specifications, facilitating subsequent review and rectification, improving the efficiency of project maintenance and the transparency of team collaboration.

[0097] In this application, when generating log files, different log files are generated based on the importance of the project. This allows the importance of issues to be distinguished when outputting results, helping users prioritize key issues. Furthermore, the log files also include the generation rules for the third naming verification rule, which allows users to clearly understand the source of the naming verification rule, making the log files more readable.

[0098] In a specific embodiment, the procedural steps shown in this application can be integrated into verification tools such as eslint or vscode, so as to facilitate the execution of the naming verification method shown in this application.

[0099] Below through Figure 5 The project naming verification method shown in this application is briefly described.

[0100] For example, see Figure 5 , Figure 5 A flowchart of another project naming verification method provided in an embodiment of the present application is shown as follows: Figure 5 As shown, it includes three steps: naming verification configuration, naming verification and log file output. Among them, the naming verification configuration is the configuration naming verification method shown in the above embodiment, for example, including how to determine the naming verification rules corresponding to each project. Naming verification includes automatic repair after naming verification and verification of the project. The project includes files and directories, and the naming verification of the project includes directory verification and file verification. After the naming verification is performed, the verification result will be written to the log file, and then the log file will be output. The log file is generated according to the severity level corresponding to the project or the severity level of the naming verification rule corresponding to the project, and the user-defined template. After the log file is generated, the log file is output.

[0101] It can be seen that in the embodiment of the present application, according to the project type, project path type and project root directory type corresponding to the project to be verified, the corresponding third naming verification rule is determined from multiple first naming verification rules, and the name of the project to be verified is named and verified according to the third naming verification rule. In this way, for different projects, a naming verification rule that matches the project type, project path type and project root directory type corresponding to each project can be determined. Based on the differences in the project types, project path types and project root directory types corresponding to different projects, different projects can obtain the naming verification rules corresponding to each project, thereby meeting the personalized naming verification requirements between different projects. At the same time, since the naming verification rules for each project are determined according to the project type, project path type and project root directory type corresponding to each project, compared to determining the naming verification rules for each project based only on the project type of each project, the naming verification rules for each project can be determined to have higher flexibility and accuracy, and the project root directory and project path are associated with the file system corresponding to each project. Determining the naming verification rules corresponding to each project based on the project root directory type and project path type can improve the naming consistency of the entire file system, thereby improving the work efficiency of the team corresponding to the project.

[0102] In accordance with the above-mentioned embodiment, please refer to Figure 6 , Figure 6 This is a functional unit block diagram of a project naming verification device provided in an embodiment of the present application. The project naming verification device is the above-mentioned server or client device, or a part of the server or client device, such as Figure 6 As shown, the project naming verification device 60 includes:

[0103] An acquisition unit 601 is configured to acquire a name of a project to be verified and a plurality of first naming verification rules, wherein each of the plurality of first naming verification rules is configured to verify the name of a project of a type corresponding to each first naming verification rule, and the plurality of first naming verification rules correspond to at least one target project level, wherein the at least one target project level is a project level between a root directory and the project to be verified under a project path corresponding to the project to be verified;

[0104] Processing unit 602 is configured to determine at least one second naming verification rule from the plurality of first naming verification rules, wherein a type corresponding to the second naming verification rule matches at least one of a project type, a project path type, and a project root directory type corresponding to the project to be verified, wherein the project path type is used to indicate a type of a first project included in the project path corresponding to the project to be verified, where the first project is a project in the project path excluding the project to be verified and the project root directory;

[0105] The processing unit 602 is further configured to determine a third naming verification rule corresponding to the item to be verified based on the at least one second naming verification rule;

[0106] The processing unit 602 is further configured to perform a name verification on the name of the item to be verified according to the third name verification rule to obtain a verification result.

[0107] In a feasible embodiment, the processing unit 602 is also used to: determine whether the item to be verified is an item corresponding to the verification exclusion rule, and the verification exclusion rule is used to exclude items that do not need to be named; if it is determined that the item to be verified is not an item corresponding to the verification exclusion rule, then execute the step of performing a naming verification on the name of the item to be verified according to the third naming verification rule.

[0108] In a feasible embodiment, if at least one second naming verification rule is single, in terms of determining at least one second naming verification rule from multiple first naming verification rules, the acquisition unit 601 is specifically used to: determine the matching order of multiple first naming verification rules, and determine the first type with the highest priority among the project type, project path type and project root directory type corresponding to the project to be verified; according to the matching order of multiple first naming verification rules, match the types corresponding to the multiple first naming verification rules with the first type until there is a second type that successfully matches the first type among the types corresponding to the multiple first naming verification rules, and determine that the naming verification rule corresponding to the second type is the second naming verification rule.

[0109] In a feasible embodiment, in terms of performing naming verification on the name of the item to be verified according to the third naming verification rule and obtaining the verification result, the processing unit 602 is specifically used to: perform preset character rule detection on the name of the item to be verified, the preset character rules include that the input name is not empty, the input name is in string format, and the string length of the input name is not zero; if it is determined that the preset character rule detection is passed, then determine the Unicode expression of the target character type corresponding to the third naming verification rule; match each character in the name of the item to be verified according to the Unicode expression of the target character type, so as to determine the target character in the name of the item to be verified, and the type of the target character is the target character type; if it is determined that the target character in the name of the item to be verified complies with the third naming verification rule, then obtain a first verification result; if it is determined that the target character in the name of the item to be verified does not comply with the third naming verification rule, then obtain a second verification result, and the verification results include a first verification result and a second verification result, the first verification result is that the naming is correct, and the second verification result is that the naming is incorrect.

[0110] In a feasible embodiment, the acquisition unit 601 is also used to: when there is no second type that successfully matches the first type among the types corresponding to the multiple first naming verification rules, determine a third type with a lower priority than the first type among the project type, project path type, and project root directory type corresponding to the project to be verified; match the types corresponding to the multiple first naming verification rules with the third type according to the matching order of the multiple first naming verification rules, until there is a fourth type that successfully matches the third type among the types corresponding to the multiple first naming verification rules, and determine that the naming verification rule corresponding to the fourth type is the second naming verification rule.

[0111] In a feasible embodiment, if there are multiple at least one second naming verification rules, in terms of determining the third naming verification rule corresponding to the project to be verified based on the at least one second naming verification rule, the acquisition unit 601 is specifically used to: if it is determined that there are conflicting fourth naming verification rules and fifth naming verification rules among the multiple second naming verification rules, then determine the fifth type and sixth type corresponding to the fourth naming verification rule and the fifth naming verification rule respectively among the project types, project path types and project root directory types corresponding to the project to be verified; determine the seventh type from the fifth type and the sixth type, the seventh type being the type with the farthest distance between the project levels corresponding to the fifth type and the sixth type and the project level corresponding to the project to be verified; exclude the naming verification rule corresponding to the seventh type from the multiple second naming verification rules to obtain the third naming verification rule.

[0112] In a feasible embodiment, the project naming verification device 60 also includes: a generation unit 603, which is used to generate a copy of the project to be verified corresponding to the project to be verified if it is determined that the verification result includes a naming error; a processing unit 602, which is also used to perform naming repair on the name of the copy of the project to be verified according to a third naming verification rule to obtain a repaired copy of the project to be verified.

[0113] In a feasible example, the generation unit 603 is also used to: if it is determined that the verification result includes a naming error, determine the project importance corresponding to the project to be verified; generate a log file corresponding to the project importance based on the name corresponding to the project to be verified, the third naming verification rule, the generation rule of the third naming verification rule, and the automatic repair status of the project to be verified, and the automatic repair status of the project to be verified includes whether the name corresponding to the project to be verified is repaired based on the third naming verification rule.

[0114] It can be understood that since the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the method embodiment part in this application should be synchronously adapted to the device embodiment part and will not be repeated here.

[0115] In the case of integrated units, such as Figure 7 As shown, Figure 7 This is a block diagram of the functional units of another project naming verification device 60 provided in an embodiment of the present application. Figure 7 In the embodiment, the project naming verification device 60 includes: a processing module 712 and a communication module 711. The processing module 712 is used to control and manage the actions of the project naming verification device 60, for example, the steps of the acquisition unit 601, the processing unit 602 and the generation unit 603, and / or other processes for executing the technology described herein. The communication module 711 is used to support the interaction between the project naming verification device 60 and other devices. Figure 7 As shown, the project naming verification device 60 may further include a storage module 713 , and the storage module 713 is used to store program codes and data of the project naming verification device 60 .

[0116] The processing module 712 may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an ASIC, an FPGA, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 711 may be a transceiver, an RF circuit, or a communication interface, and the like. The storage module 713 may be a memory.

[0117] Among them, all relevant contents of each scenario involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here. Figure 2 The project naming verification method shown.

[0118] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function according to the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0119] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 may include one or more of the following components: a processor 801, a memory 802 and a communication interface 803. The processor 801, the memory 802 and the communication interface 803 are interconnected and perform communication with each other. The memory 802 may store one or more computer programs, and the one or more computer programs may be configured to implement the methods described in the above embodiments when executed by one or more processors 801.

[0120] The processor 801 may include one or more processing cores. The processor 801 uses various interfaces and lines to connect the various parts of the entire electronic device 800, and executes various functions and processes data of the electronic device 800 by running or executing instructions, programs, code sets or instruction sets stored in the memory 802, and calling data stored in the memory 802. Optionally, the processor 801 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 801 can integrate one or more combinations of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. It is understandable that the above-mentioned modem may not be integrated into the processor 801, but may be implemented separately through a communication chip.

[0121] The memory 802 may include a random access memory (RAM) or a read-only memory (ROM). The memory 802 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device 800 during use.

[0122] It is understandable that the electronic device 800 may include more or fewer structural elements than those in the above structural block diagram, for example, including a power module, physical buttons, WiFi (Wireless Fidelity) module, speakers, Bluetooth modules, sensors, etc., which are not limited here.

[0123] The electronic device 800 may be the server or client device, or a part of the server or client device.

[0124] An embodiment of the present application provides a computer-readable storage medium, wherein program data is stored in the computer-readable storage medium. When the program data is executed by a processor, the program data is used to execute part or all of the steps of any one of the project naming verification methods recorded in the above method embodiments.

[0125] The present application also provides a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute some or all of the steps of any of the project naming verification methods described in the above method embodiments. The computer program product may be a software installation package.

[0126] It should be noted that for any of the aforementioned method embodiments of the project naming verification method, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited to the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by this application.

[0127] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality of components or steps. The fact that certain measures are recited in different dependent claims does not mean that these measures cannot be combined to produce good results.

[0128] Those skilled in the art will understand that all or part of the steps in the various methods of any of the above-mentioned project naming verification method embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which may include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0129] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of a project naming verification method and device of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the idea of ​​a project naming verification method and device of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, hardware products, and computer program products of the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0131] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0133] It can be understood that any product that is controlled or configured to execute the processing method of the flowchart described in the method embodiment of a project naming verification method of the present application, such as the terminal and computer program product in the above flowchart, falls within the scope of the related products described in this application.

[0134] Obviously, those skilled in the art may make various modifications and variations to the project naming verification method and apparatus provided in this application without departing from the spirit and scope of this application. Thus, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application is intended to include such modifications and variations.

Claims

1. A project naming verification method, characterized in that: The method comprises: Obtaining a name of a project to be verified and multiple first naming verification rules, where each of the multiple first naming verification rules is used to verify the name of a project of a type corresponding to each first naming verification rule, and the multiple first naming verification rules correspond to at least one target project level, where the at least one target project level is a project level between a root directory and the project to be verified under a project path corresponding to the project to be verified; Determining at least one second naming verification rule from the multiple first naming verification rules, where a type corresponding to the second naming verification rule matches at least one of a project type, a project path type, and a project root directory type corresponding to the project to be verified, where the project path type is used to represent a type of a first project included in the project path corresponding to the project to be verified, where the first project is a project in the project path excluding the project to be verified and the project root directory; Determining a third naming verification rule corresponding to the item to be verified according to the at least one second naming verification rule; The name of the item to be verified is verified according to the third naming verification rule to obtain a verification result.

2. The method according to claim 1, characterized in that The step of performing name verification on the name of the item to be verified according to the third name verification rule to obtain a verification result includes: Performing a preset character rule check on the name of the item to be verified, wherein the preset character rule includes that the input name is not empty, the input name is in a string format, and the string length of the input name is not zero; If it is determined that the preset character rule detection passes, determining the Unicode expression of the target character type corresponding to the third naming verification rule; Matching each character in the name of the item to be verified according to the Unicode expression of the target character type, thereby determining the target character in the name of the item to be verified, the type of the target character being the target character type; If it is determined that the target characters in the name of the item to be verified comply with the third naming verification rule, a first verification result is obtained; If it is determined that the target characters in the name of the item to be verified do not comply with the third naming verification rule, a second verification result is obtained, and the verification result includes the first verification result and the second verification result. The first verification result is that the naming is correct, and the second verification result is that the naming is incorrect.

3. The method according to claim 1, characterized in that If the at least one second naming verification rule is a single one, determining the at least one second naming verification rule from the plurality of first naming verification rules includes: Determine a matching order of the plurality of first naming verification rules, and determine a first type with the highest priority among the project type, project path type, and project root directory type corresponding to the project to be verified; According to the matching order of the multiple first naming verification rules, the types corresponding to the multiple first naming verification rules are matched with the first type until there is a second type among the types corresponding to the multiple first naming verification rules that successfully matches the first type, and the naming verification rule corresponding to the second type is determined to be the second naming verification rule.

4. The method according to claim 3, characterized in that The method further comprises: When there is no second type that successfully matches the first type among the types corresponding to the multiple first naming verification rules, determining a third type with a lower priority than the first type among the project type, project path type, and project root directory type corresponding to the item to be verified; According to the matching order of the multiple first naming verification rules, the types corresponding to the multiple first naming verification rules are matched with the third type until there is a fourth type among the types corresponding to the multiple first naming verification rules that successfully matches the third type, and the naming verification rule corresponding to the fourth type is determined to be the second naming verification rule.

5. The method according to claim 3 or 4, characterized in that If there are multiple at least one second naming verification rules, determining a third naming verification rule corresponding to the item to be verified according to the at least one second naming verification rule includes: If it is determined that there are conflicting fourth and fifth naming verification rules among the multiple second naming verification rules, then determining a fifth type and a sixth type corresponding to the fourth and fifth naming verification rules, respectively, among the project types, project path types, and project root directory types corresponding to the project to be verified; Determine a seventh type from the fifth type and the sixth type, the seventh type being a type having a farthest distance between a project level corresponding to the fifth type and the sixth type and a project level corresponding to the item to be verified; The naming verification rule corresponding to the seventh type is excluded from the plurality of second naming verification rules to obtain the third naming verification rule.

6. The method according to any one of claims 1 to 5, characterized in that After performing name verification on the name of the item to be verified according to the third name verification rule and obtaining a verification result, the method further includes: If it is determined that the verification result includes a naming error, generating a copy of the item to be verified corresponding to the item to be verified; According to the third naming verification rule, the name of the copy of the item to be verified is repaired to obtain a repaired copy of the item to be verified.

7. The method according to any one of claims 1 to 6, characterized in that After performing name verification on the name of the item to be verified according to the third name verification rule and obtaining a verification result, the method further includes: If it is determined that the verification result includes a naming error, determining the project importance corresponding to the item to be verified; Based on the name corresponding to the item to be verified, the third naming verification rule, the generation rule of the third naming verification rule and the automatic repair status of the item to be verified, a log file corresponding to the importance of the item is generated. The automatic repair status of the item to be verified includes whether the name corresponding to the item to be verified is repaired based on the third naming verification rule.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Determine whether the item to be verified is an item corresponding to a verification exclusion rule, where the verification exclusion rule is used to exclude items that do not require naming verification; If it is determined that the item to be verified is not an item corresponding to the verification exclusion rule, a step of performing a naming verification on the name of the item to be verified according to the third naming verification rule is executed.

9. A project naming verification device, characterized in that: The device comprises: an acquiring unit, configured to acquire a name of a project to be verified and a plurality of first naming verification rules, wherein each of the plurality of first naming verification rules is used to verify the name of a project of a type corresponding to each first naming verification rule, and wherein the plurality of first naming verification rules correspond to at least one target project level, and the at least one target project level is a project level between a root directory and the project to be verified under a project path corresponding to the project to be verified; a processing unit, configured to determine at least one second naming verification rule from the plurality of first naming verification rules, wherein a type corresponding to the second naming verification rule matches at least one of a project type, a project path type, and a project root directory type corresponding to the project to be verified, wherein the project path type is used to indicate a type of a first project included in the project path corresponding to the project to be verified, the first project being a project included in the project path excluding the project to be verified and the project root directory; The processing unit is further configured to determine a third naming verification rule corresponding to the item to be verified based on the at least one second naming verification rule; The processing unit is further configured to perform a name verification on the name of the item to be verified according to the third name verification rule to obtain a verification result.

10. An electronic device, characterized in that: The device comprises: A processor, a memory, and a communication interface, wherein the processor, the memory, and the communication interface are interconnected and perform communication work among each other; The memory stores executable program code, and the communication interface is used for wireless communication; The processor is used to call the executable program code stored in the memory and execute the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 8.