CN109343892A - It is a kind of for detecting the method, apparatus and computer equipment of file - Google Patents

It is a kind of for detecting the method, apparatus and computer equipment of file Download PDF

Info

Publication number
CN109343892A
CN109343892A CN201810983505.2A CN201810983505A CN109343892A CN 109343892 A CN109343892 A CN 109343892A CN 201810983505 A CN201810983505 A CN 201810983505A CN 109343892 A CN109343892 A CN 109343892A
Authority
CN
China
Prior art keywords
file
code
ignoring
target file
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810983505.2A
Other languages
Chinese (zh)
Inventor
崔俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201810983505.2A priority Critical patent/CN109343892A/en
Publication of CN109343892A publication Critical patent/CN109343892A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present application provides a kind of for detecting the method, apparatus and computer equipment of file, and method includes: that the code obtained in local code warehouse ignores file;Ignored in file using preset inspection policies detection code and ignores order with the presence or absence of file destination is corresponding;If it does not exist, then by file destination it is corresponding ignore order and be updated to code ignore in file, form the new code for being ignored to file destination and ignore file;In this way, ignore file before upload code file to code and detect, if code ignore in file there is no file destination is corresponding ignore order when, form the new code for being ignored to file destination and ignore file;File can so be ignored using new code to ignore institute's ignored file destination in need, the quantity of documents of upload is reduced, improve uploading rate;And ensuring to be uploaded to the file in the code storage of distal end is the file really needed, avoids the operation collapse of distal end code storage.

Description

Method and device for detecting file and computer equipment
Technical Field
The invention relates to the technical field of software development, in particular to a method and a device for detecting files and computer equipment.
Background
Often, the code version management software git will need to be utilized to submit code into a remote code repository during the project development process. However, when the code is compiled, because different computer languages generate a large amount of dependent data package files in the compiling process, the data package files are large, and if the data package files are submitted to a remote code warehouse together when the code is submitted, the submitting rate is slow; long such uploads result in a remote code repository running crash.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method, apparatus and computer device for detecting a file that overcome or at least partially solve the above problems.
In a first aspect of the present invention, a method for detecting a file is provided, the method comprising:
acquiring a code ignoring file in a local code warehouse;
detecting whether an ignoring command corresponding to the target file exists in the code ignoring file or not by using a preset detection strategy; and if the target file does not exist, updating the ignoring command corresponding to the target file into the code ignoring file to form a new code ignoring file for ignoring the target file.
In the foregoing solution, the detecting, by using a preset detection policy, whether an ignore command corresponding to a target file exists in the code ignore file includes:
determining the file type of the target file;
and detecting whether a corresponding target file exists in a code directory of the local code repository based on the file type of the target file, and if so, determining that an ignoring command corresponding to the target file does not exist in the code ignoring file.
In the foregoing solution, the determining the file type of the target file includes:
acquiring an extension of the target file;
determining a file type of the target file based on the extension of the target file.
In the above scheme, the detecting whether the corresponding target file exists in the code directory in the local code repository based on the file type of the target file includes:
traversing the files in the code directory to acquire the file types of the files in the code directory;
and matching the file type of the target file with the file type of the file in the code directory, and if the matching is successful, determining that the corresponding target file exists.
In the foregoing solution, the updating the ignore command corresponding to the target file to the code ignore file includes:
adding an ignoring command corresponding to the target file into the code ignoring file;
and refreshing the code ignoring file.
In the foregoing scheme, after the updating the ignore command corresponding to the target file into the code ignore file to form a new code ignore file for ignoring the target file, the method includes:
processing an original code file of the local code repository by using the new code ignoring file so as to ignore the target file in the original code file;
and uploading the code file after the target file is ignored to a remote code warehouse.
In the above solution, the target file includes: dependent files respectively generated when the code files are compiled based on a plurality of types of computer programming languages.
In a second aspect of the present invention, there is provided an apparatus for detecting a file, the apparatus comprising:
the acquisition unit is used for acquiring a code neglecting file in the local code warehouse;
the detection unit is used for detecting whether an ignoring command corresponding to the target file exists in the code ignoring file by using a preset detection strategy;
and the updating unit is used for updating the ignoring command corresponding to the target file to the code ignoring file when the ignoring command corresponding to the target file does not exist in the code ignoring file, so as to form a new code ignoring file for ignoring the target file.
In the above solution, the detecting unit includes:
a determining subunit, configured to determine a file type of the target file;
and the detecting subunit is configured to detect whether a corresponding target file exists in the code directory of the local code repository based on the file type of the target file, and if the target file exists, determine that an ignore command corresponding to the target file does not exist in the code ignore file.
In the foregoing solution, the determining subunit is specifically configured to:
acquiring an extension of the target file;
determining a file type of the target file based on the extension of the target file.
In the foregoing solution, the detecting subunit is specifically configured to:
traversing the files in the code directory to acquire the file types of the files in the code directory;
and in the traversal process, matching the file type of the target file with the file type of the file in the code directory, and if the matching is successful, determining that the corresponding target file exists.
In the foregoing solution, the updating unit is specifically configured to:
adding an ignoring command corresponding to the target file into the code ignoring file;
and refreshing the code ignoring file.
In the above scheme, the apparatus further comprises: an uploading unit is used for uploading the data to the storage unit,
the code ignoring device is used for updating an ignoring command corresponding to the target file into the code ignoring file, forming a new code ignoring file for ignoring the target file, and then processing an original code file of the local code warehouse by using the new code ignoring file so as to ignore the target file in the original code file;
and uploading the code file after the target file is ignored to a remote code warehouse.
In the above solution, the target file includes: dependent files respectively generated when the code files are compiled based on a plurality of types of computer programming languages.
In a third aspect of the invention, a computer-readable storage medium is provided, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the method of any of the above.
In a third aspect of the present invention, there is provided a computer device for detecting a file, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein the memory stores program instructions executable by the processor, and wherein the processor is capable of performing the steps of any of the methods described above when invoked by the program instructions.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
the embodiment of the application provides a method, a device and computer equipment for detecting files, wherein the method comprises the following steps: acquiring a code ignoring file in a local code warehouse; detecting whether an ignoring command corresponding to the target file exists in the code ignoring file or not by using a preset detection strategy; if the target file does not exist, updating the ignoring command corresponding to the target file into the code ignoring file to form a new code ignoring file for ignoring the target file; in this way, before the code file is passed, the code ignoring file is detected, and if the code ignoring file does not have an ignoring command corresponding to the target file, a new code ignoring file for ignoring the target file is formed; then, the new code ignoring file can be used for ignoring all target files needing to be ignored, so that the number of uploaded files is reduced, and the uploading speed is improved; and the file uploaded to the remote code warehouse can be ensured to be a really needed file, and the running crash of the remote code warehouse is avoided.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a schematic flow diagram of a method for detecting a file according to one embodiment of the invention;
FIG. 2 is a schematic diagram of an apparatus for detecting a file according to an embodiment of the present invention;
fig. 3 shows a schematic structural diagram of a detection unit according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a method, a device and computer equipment for detecting files, which are used for solving the technical problems that when a code file is uploaded to a remote code warehouse, a data packet file generated by compiling the code file is submitted to the remote code warehouse together, so that the submission rate is slow and the remote code warehouse is crashed in operation in the prior art.
Example one
The present embodiment provides a method for detecting a file, as shown in fig. 1, the method includes:
s110, acquiring a code ignoring file in a local code warehouse;
during the development of a project, the code is usually compiled by using various types of computer programming languages, and a large number of various types of data package files, such as object files and archive files, are generated during the compilation process. Such files need not be version-tracked during development, and therefore, when code files are submitted to a remote code repository, files of this type need to be ignored (which can be understood as filtered out). The types of the data packet files may include a binary packet, a jar packet, a python packet, a docker packet, and the like.
In general, the code file is ignored by using the code ignoring file gitignore in the local code repository, but sometimes the ignoring rule configured in the gitignore file is incomplete, and the ignoring effect is not good if the gitignore file is not detected. Therefore, in this embodiment, before uploading the code file to the remote code repository, the gitignore file in the local code repository needs to be acquired so that the gitignore file can be detected.
The code file is added into the local cache by utilizing the git add, the code file in the local cache is stored into the local code warehouse by utilizing the git commit, and the code file in the local code warehouse is uploaded to the remote code warehouse by utilizing the git push.
S111, detecting whether an ignoring command corresponding to the target file exists in the code ignoring file by using a preset detection strategy; and if the target file does not exist, updating the ignoring command corresponding to the target file into the code ignoring file.
After the code ignoring file gitignore file is obtained, whether an ignoring command corresponding to the target file exists in the code ignoring file is detected by using a preset detection strategy, if not, the ignoring command corresponding to the preset target file is updated to the code ignoring file, and a new code ignoring file for ignoring the target file is formed so that the target file can be ignored.
The object file is a file to be ignored, and the object file may include dependent files respectively generated when code files are compiled based on multiple types of computer programming languages, such as a dependent file generated when code files are compiled using java language and a dependent file generated when code files are compiled using C + + language. The detection strategy is set in the detection script, and when the gitignore file needs to be detected, the detection script is placed into a local code warehouse in advance.
As an optional embodiment, detecting whether an ignore command corresponding to a target file exists in a code ignore file by using a preset detection policy includes:
determining the file type of a target file;
and detecting whether a corresponding target file exists in a code directory of a local code warehouse or not based on the file type of the target file, and if the target file exists, indicating that the target file is not ignored, determining that a ignoring command corresponding to the target file does not exist in the code ignoring file.
Here, as an alternative embodiment, the determining the file type of the target file includes:
acquiring an extension name of a target file;
the file type of the target file is determined based on the extension of the target file.
For example, if the file type of the target file is jar package, the corresponding extension is jar, and therefore when the extension of the target file is obtained, the type of the target file can be determined accordingly.
As an alternative embodiment, detecting whether a corresponding target file exists under a code directory in a local code repository based on a file type of the target file includes:
traversing files in the code directory to acquire file types of all the files in the code directory;
and matching the file type of the target file with the file types of all files in the code directory, and if the matching is successful, determining that the corresponding target file exists in the code directory.
When the corresponding target file exists in the code directory, the fact that the code ignoring file does not have the ignoring command corresponding to the configured target file is indicated, the ignoring command corresponding to the target file is automatically updated to the code ignoring file, and a new code ignoring file for ignoring the target file is formed so that the target file can be ignored. Wherein, the ignore command corresponding to the target file is preset.
Here, the target file may include files of one file type and files of multiple file types, and when the target file includes multiple types, in order to improve matching efficiency, the file types of the multiple target files may be matched with the file types of all files in the code directory at the same time; of course, in order to improve the matching accuracy, the matching may be performed successively in a preset matching order.
As an optional embodiment, updating an ignore command corresponding to a preset target file to the code ignore file includes:
adding an ignoring command corresponding to the target file into the code ignoring file;
the refresh code ignores the file.
Here, the different types of target files correspond to different ignore commands, which are preset according to the types of the target files. For example, when the target file is generated by compiling using java language, the corresponding ignore command is:
#--->Java
*.class
#Mobile Tools for Java(J2ME)
.mtj.tmp/
#Package Files#
*.jar
*.war
*.ear
#virtual machine crash logs,see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
for example, when the target file is compiled using C + + language, the corresponding ignore command is:
.obj/
.objs/
callapp_engine/src/proto/*.cc
callapp_engine/src/proto/*.h
callapp_engine/src/proto/*.py
callapp_engine/src/proto/*.pyc
callapp_engine/ut/commercial_promotion/proto/*.pyc
libcallapp_engine.so*
libcallapp_engine*.rpm
.*.swp
test/
backup-rpms/
qconf.log.*
as an alternative embodiment, after the ignoring command corresponding to the target file is updated to the code ignoring file, the method includes:
processing the original code file of the local code warehouse by using the new code ignoring file so as to ignore the target file in the original code file;
and uploading the code file after the target file is ignored to a remote code warehouse.
Here, in order to improve the ignoring efficiency, after the file type of the target file is matched with the file type of the file in the code directory, the file successfully matched may be stored in a preset folder, and when the code file in the local code repository is ignored by using the code ignoring file, the folder may be directly ignored.
This ensures that the code files uploaded to the remote code repository are all the required, correct files.
Based on the same inventive concept, the application also provides a device for ignoring the file, which is detailed in embodiment two.
Example two
The embodiment provides an apparatus for detecting a document, as shown in fig. 2, the apparatus includes: an acquisition unit 21, a detection unit 22, and an update unit 23; wherein,
during the development of a project, the code is usually compiled by using various types of computer programming languages, and a large number of various types of data package files, such as object files and archive files, are generated during the compilation process. Such files need not be version-tracked during development, and therefore, when code files are submitted to a remote code repository, files of this type need to be ignored (which can be understood as filtered out). The types of the data packet files may include a binary packet, a jar packet, a python packet, a docker packet, and the like.
In general, the code file is ignored by using the code ignoring file gitignore in the local code repository, but sometimes the ignoring rule configured in the gitignore file is incomplete, and the ignoring effect is not good if the gitignore file is not detected. The obtaining unit 21 in this embodiment is therefore configured to obtain the code ignore file in the local code repository before uploading the code file to the remote code repository, so as to be able to detect the gitignore file.
The code file is added into the local cache by utilizing the git add, the code file in the local cache is stored into the local code warehouse by utilizing the git commit, and the code file in the local code warehouse is uploaded to the remote code warehouse by utilizing the git push.
After the code ignoring file gitignore file is obtained, the detecting unit 22 is configured to detect whether an ignoring command corresponding to the target file exists in the code ignoring file by using a preset detection policy; the updating unit 23 is configured to update the ignoring command corresponding to the target file into the code ignoring file when the ignoring command corresponding to the target file does not exist in the code ignoring file, so as to form a new code ignoring file for ignoring the target file, so that the target file can be ignored.
The object file is a file to be ignored, and the object file may include a plurality of dependent files respectively generated when the code file is compiled based on the type computer programming language, such as a dependent file generated when the code file is compiled using java language and a dependent file generated when the code file is compiled using C + + language. The detection strategy is set in the detection script, and when the gitignore file needs to be detected, the detection script is placed into a local code warehouse in advance.
As an alternative embodiment, referring to fig. 3, the detection unit 21 includes: a determination subunit 31 and a detection subunit 32;
the determining subunit 31 is configured to determine a file type of the target file;
the detecting subunit 32 is configured to detect, based on the file type of the target file, whether a corresponding target file exists in the code directory of the local code repository, and if the target file exists, determine that an ignore command corresponding to the target file does not exist in the code ignore file.
As an alternative embodiment, the determining subunit 31 is specifically configured to:
acquiring an extension name of a target file;
the file type of the target file is determined based on the extension of the target file.
For example, if the file type of the target file is jar package, the corresponding extension is jar, and therefore when the extension of the target file is obtained, the type of the target file can be determined accordingly.
As an alternative embodiment, the detecting subunit 32 is specifically configured to:
traversing files in the code directory to acquire file types of all the files in the code directory;
and matching the file type of the target file with the file types of all files in the code directory, and if the matching is successful, determining that the corresponding target file exists in the code directory.
When it is determined that the corresponding target file exists in the code directory, it indicates that the code ignoring file does not have the ignoring command corresponding to the configured target file, and the updating unit 23 automatically updates the ignoring command corresponding to the target file into the code ignoring file to form a new code ignoring file for ignoring the target file, so as to ignore the target file. Wherein, the ignore command corresponding to the target file is preset.
Here, the target file may include files of one file type and files of multiple file types, and when the target file includes multiple types, in matching, in order to improve matching efficiency, the detection subunit 32 may match the file types of the multiple target files with the file types of all files in the code directory at the same time; of course, in order to improve the matching accuracy, the matching may be performed successively in a preset matching order.
As an alternative embodiment, the updating unit 23 is specifically configured to:
adding an ignoring command corresponding to the target file into the code ignoring file;
the refresh code ignores the file.
Here, the different types of target files correspond to different ignore commands, which are preset according to the types of the target files. For example, when the target file is generated by compiling using java language, the corresponding ignore command is:
#--->Java
*.class
#Mobile Tools for Java(J2ME)
.mtj.tmp/
#Package Files#
*.jar
*.war
*.ear
#virtual machine crash logs,see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
for example, when the target file is compiled using C + + language, the corresponding ignore command is:
.obj/
.objs/
callapp_engine/src/proto/*.cc
callapp_engine/src/proto/*.h
callapp_engine/src/proto/*.py
callapp_engine/src/proto/*.pyc
callapp_engine/ut/commercial_promotion/proto/*.pyc
libcallapp_engine.so*
libcallapp_engine*.rpm
.*.swp
test/
backup-rpms/
qconf.log.*
with continued reference to fig. 2, the apparatus further comprises an uploading unit 24, specifically configured to: after updating a preset ignoring command corresponding to the target file into a code ignoring file, processing an original code file of a local code warehouse by using the new code ignoring file so as to ignore the target file in the original code file;
and uploading the code file after the target file is ignored to a remote code warehouse.
Here, in order to improve the ignoring efficiency, the detecting subunit 32 may store the successfully matched file in a preset folder after matching the file type of the target file with the file type of the file in the code directory, and the uploading unit 23 may directly ignore the folder when ignoring the code file in the local code repository by using the code ignoring file.
This ensures that the code files uploaded to the remote code repository are all the required, correct files.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
the embodiment of the application provides a method, a device and computer equipment for detecting files, wherein the method comprises the following steps: acquiring a code ignoring file in a local code warehouse; detecting whether an ignoring command corresponding to the target file exists in the code ignoring file or not by using a preset detection strategy; if the target file does not exist, updating the ignoring command corresponding to the target file into the code ignoring file to form a new code ignoring file for ignoring the target file; in this way, before the code file is passed, the code ignoring file is detected, and if the code ignoring file does not have an ignoring command corresponding to the target file, a new code ignoring file for ignoring the target file is formed; then, the new code ignoring file can be used for ignoring all target files needing to be ignored, so that the number of uploaded files is reduced, and the uploading speed is improved; and the file uploaded to the remote code warehouse can be ensured to be a really needed file, and the running crash of the remote code warehouse is avoided.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses, A1, a method for detecting a file, the method comprising:
acquiring a code ignoring file in a local code warehouse;
detecting whether an ignoring command corresponding to the target file exists in the code ignoring file or not by using a preset detection strategy; and if the target file does not exist, updating the ignoring command corresponding to the target file into the code ignoring file to form a new code ignoring file for ignoring the target file.
A2, the method as in A1, wherein the detecting whether the code ignoring file has an ignoring command corresponding to a target file by using a preset detection strategy includes:
determining the file type of the target file;
and detecting whether a corresponding target file exists in a code directory of the local code repository based on the file type of the target file, and if so, determining that an ignoring command corresponding to the target file does not exist in the code ignoring file.
A3, the method of A2, the determining the file type of the target file, comprising:
acquiring an extension of the target file;
determining a file type of the target file based on the extension of the target file.
A4, the method of A2, the detecting whether there is a corresponding target file under a code directory in the local code repository based on a file type of the target file, comprising:
traversing the files in the code directory to acquire the file types of the files in the code directory;
and matching the file type of the target file with the file type of the file in the code directory, and if the matching is successful, determining that the corresponding target file exists.
A5, the method as in A1, wherein the updating the ignore command corresponding to the target file into the code ignore file includes:
adding an ignoring command corresponding to the target file into the code ignoring file;
and refreshing the code ignoring file.
A6, the method as in a1, wherein the updating the ignore command corresponding to the target file into the code ignore file to form a new code ignore file for ignoring the target file comprises:
processing an original code file of the local code repository by using the new code ignoring file so as to ignore the target file in the original code file;
and uploading the code file after the target file is ignored to a remote code warehouse.
A7, the method as in any one of A1-A6, the object file comprising: dependent files respectively generated when the code files are compiled based on a plurality of types of computer programming languages.
B8, an apparatus for detecting a file, the apparatus comprising:
the acquisition unit is used for acquiring a code neglecting file in the local code warehouse;
the detection unit is used for detecting whether an ignoring command corresponding to the target file exists in the code ignoring file by using a preset detection strategy;
and the updating unit is used for updating the ignoring command corresponding to the target file to the code ignoring file when the ignoring command corresponding to the target file does not exist in the code ignoring file, so as to form a new code ignoring file for ignoring the target file.
B9, the device as in B8, the detecting unit comprises:
a determining subunit, configured to determine a file type of the target file;
and the detecting subunit is configured to detect whether a corresponding target file exists in the code directory of the local code repository based on the file type of the target file, and if the target file exists, determine that an ignore command corresponding to the target file does not exist in the code ignore file.
B10, the apparatus of B9, the determining subunit being configured to:
acquiring an extension of the target file;
determining a file type of the target file based on the extension of the target file.
B11, the device of B9, wherein the detecting subunit is specifically configured to:
traversing the files in the code directory to acquire the file types of the files in the code directory;
and in the traversal process, matching the file type of the target file with the file type of the file in the code directory, and if the matching is successful, determining that the corresponding target file exists.
B12, the apparatus as in B8, the update unit being specifically configured to:
adding an ignoring command corresponding to the target file into the code ignoring file;
and refreshing the code ignoring file.
B13, the apparatus of B8, further comprising: an uploading unit is used for uploading the data to the storage unit,
the code ignoring device is used for updating an ignoring command corresponding to the target file into the code ignoring file, forming a new code ignoring file for ignoring the target file, and then processing an original code file of the local code warehouse by using the new code ignoring file so as to ignore the target file in the original code file;
and uploading the code file after the target file is ignored to a remote code warehouse.
B14, the device as in any one of B8-B13, the object file comprising: dependent files respectively generated when the code files are compiled based on a plurality of types of computer programming languages.
C15, a computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of any one of a1 to a 7.
D16, a computer device for detecting files, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein the memory stores program instructions executable by the processor to perform the steps of the method of any of A1 through A7.

Claims (10)

1. A method for detecting a file, the method comprising:
acquiring a code ignoring file in a local code warehouse;
detecting whether an ignoring command corresponding to the target file exists in the code ignoring file or not by using a preset detection strategy; and if the target file does not exist, updating the ignoring command corresponding to the target file into the code ignoring file to form a new code ignoring file for ignoring the target file.
2. The method of claim 1, wherein the detecting whether the code ignoring file has an ignoring command corresponding to a target file by using a preset detection policy comprises:
determining the file type of the target file;
and detecting whether a corresponding target file exists in a code directory of the local code repository based on the file type of the target file, and if so, determining that an ignoring command corresponding to the target file does not exist in the code ignoring file.
3. The method of claim 2, wherein said determining a file type of said target file comprises:
acquiring an extension of the target file;
determining a file type of the target file based on the extension of the target file.
4. The method of claim 2, wherein the detecting whether a corresponding target file exists under a code directory in the local code repository based on the file type of the target file comprises:
traversing the files in the code directory to acquire the file types of the files in the code directory;
and matching the file type of the target file with the file type of the file in the code directory, and if the matching is successful, determining that the corresponding target file exists.
5. An apparatus for detecting a document, the apparatus comprising:
the acquisition unit is used for acquiring a code neglecting file in the local code warehouse;
the detection unit is used for detecting whether an ignoring command corresponding to the target file exists in the code ignoring file by using a preset detection strategy;
and the updating unit is used for updating the ignoring command corresponding to the target file to the code ignoring file when the ignoring command corresponding to the target file does not exist in the code ignoring file, so as to form a new code ignoring file for ignoring the target file.
6. The apparatus of claim 5, wherein the detection unit comprises:
a determining subunit, configured to determine a file type of the target file;
and the detecting subunit is configured to detect whether a corresponding target file exists in the code directory of the local code repository based on the file type of the target file, and if the target file exists, determine that an ignore command corresponding to the target file does not exist in the code ignore file.
7. The apparatus of claim 6, wherein the determining subunit is specifically configured to:
acquiring an extension of the target file;
determining a file type of the target file based on the extension of the target file.
8. The apparatus of claim 6, wherein the detection subunit is specifically configured to:
traversing the files in the code directory to acquire the file types of the files in the code directory;
and in the traversal process, matching the file type of the target file with the file type of the file in the code directory, and if the matching is successful, determining that the corresponding target file exists.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
10. A computer device for detecting files, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein the memory stores program instructions executable by the processor, and wherein the processor is capable of executing the steps of the method of any of claims 1 to 4 when invoked by the program instructions.
CN201810983505.2A 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file Pending CN109343892A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810983505.2A CN109343892A (en) 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810983505.2A CN109343892A (en) 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file

Publications (1)

Publication Number Publication Date
CN109343892A true CN109343892A (en) 2019-02-15

Family

ID=65291906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810983505.2A Pending CN109343892A (en) 2018-08-27 2018-08-27 It is a kind of for detecting the method, apparatus and computer equipment of file

Country Status (1)

Country Link
CN (1) CN109343892A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114398319A (en) * 2021-12-17 2022-04-26 苏州浪潮智能科技有限公司 File traversal method and system with directory ignoring mechanism

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893502A (en) * 2016-03-29 2016-08-24 广州酷狗计算机科技有限公司 Code synchronization method and device
CN106201861A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 The detection method of a kind of code quality and device
CN106776728A (en) * 2016-11-14 2017-05-31 上海斐讯数据通信技术有限公司 Code check method, system and development platform based on log file analysis
US20170220337A1 (en) * 2016-01-29 2017-08-03 International Business Machines Corporation Verifying source code in disparate source control systems
CN107977218A (en) * 2017-11-23 2018-05-01 武汉斗鱼网络科技有限公司 Code update method, device, electronic equipment and readable storage medium storing program for executing
CN108334333A (en) * 2018-01-05 2018-07-27 武汉斗鱼网络科技有限公司 A kind of source code library update method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201861A (en) * 2015-05-07 2016-12-07 阿里巴巴集团控股有限公司 The detection method of a kind of code quality and device
US20170220337A1 (en) * 2016-01-29 2017-08-03 International Business Machines Corporation Verifying source code in disparate source control systems
CN105893502A (en) * 2016-03-29 2016-08-24 广州酷狗计算机科技有限公司 Code synchronization method and device
CN106776728A (en) * 2016-11-14 2017-05-31 上海斐讯数据通信技术有限公司 Code check method, system and development platform based on log file analysis
CN107977218A (en) * 2017-11-23 2018-05-01 武汉斗鱼网络科技有限公司 Code update method, device, electronic equipment and readable storage medium storing program for executing
CN108334333A (en) * 2018-01-05 2018-07-27 武汉斗鱼网络科技有限公司 A kind of source code library update method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114398319A (en) * 2021-12-17 2022-04-26 苏州浪潮智能科技有限公司 File traversal method and system with directory ignoring mechanism
CN114398319B (en) * 2021-12-17 2024-01-12 苏州浪潮智能科技有限公司 File traversal method and system with directory neglect mechanism

Similar Documents

Publication Publication Date Title
US10613971B1 (en) Autonomous testing of web-based applications
US10235141B2 (en) Method and system for providing source code suggestion to a user in real-time
US8555252B2 (en) Apparatus and method for loading and updating codes of cluster-based java application system
US20130191439A1 (en) Managing script file dependencies and load times
US20210373870A1 (en) Method and device for building images
US8843904B2 (en) Automated building and retargeting of architecture-dependent assets
CN104536810B (en) A kind of method for detecting abnormality and device based on stack
US20200304366A1 (en) Routing configuration method of view files, storage medium, terminal device and apparatus
US20140033314A1 (en) Validation of function call parameters
US9588945B2 (en) Comparing webpage elements having asynchronous functionality
US11474796B1 (en) Build system for distributed applications
US9965256B2 (en) Method and system for evaluating computational algorithms described in printed publications
US20140317489A1 (en) Device-independent validation of website elements
CN113384896A (en) Unity-based resource packaging method, device, equipment and medium
CN114816816A (en) Collapse stack information processing method, device, equipment and storage medium
CN109343892A (en) It is a kind of for detecting the method, apparatus and computer equipment of file
CN106657422B (en) Method, device and system for crawling website page and storage medium
US20170344461A1 (en) Automated exception resolution during a software development session based on previous exception encounters
TWI517045B (en) JAVA cluster application system code loading and upgrading devices and methods
US9747085B2 (en) Source code generation from prototype source
CN111324373B (en) Method and device for sub-coding warehouse on multiple engineering files and computing equipment
US11195175B2 (en) Systems and methods for electronic payment processing based on typed graph of payment lifecycle
CN111651189B (en) Product delivery method and device of continuous integrated system and electronic equipment
CN105630889B (en) Universal caching method and device
CN111273940B (en) Method and device for uploading program file to code warehouse

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190215